[RTL] Use "visible characters" property for inline object visibility

This commit is contained in:
bruvzg
2024-03-11 16:28:58 +02:00
parent f040a351c2
commit 433de7f1a8
11 changed files with 137 additions and 12 deletions

View File

@ -293,6 +293,8 @@ void TextServerExtension::_bind_methods() {
GDVIRTUAL_BIND(_shaped_text_get_objects, "shaped");
GDVIRTUAL_BIND(_shaped_text_get_object_rect, "shaped", "key");
GDVIRTUAL_BIND(_shaped_text_get_object_range, "shaped", "key");
GDVIRTUAL_BIND(_shaped_text_get_object_glyph, "shaped", "key");
GDVIRTUAL_BIND(_shaped_text_get_size, "shaped");
GDVIRTUAL_BIND(_shaped_text_get_ascent, "shaped");
@ -1284,6 +1286,18 @@ Rect2 TextServerExtension::shaped_text_get_object_rect(const RID &p_shaped, cons
return ret;
}
Vector2i TextServerExtension::shaped_text_get_object_range(const RID &p_shaped, const Variant &p_key) const {
Vector2i ret;
GDVIRTUAL_CALL(_shaped_text_get_object_range, p_shaped, p_key, ret);
return ret;
}
int64_t TextServerExtension::shaped_text_get_object_glyph(const RID &p_shaped, const Variant &p_key) const {
int64_t ret = -1;
GDVIRTUAL_CALL(_shaped_text_get_object_glyph, p_shaped, p_key, ret);
return ret;
}
Size2 TextServerExtension::shaped_text_get_size(const RID &p_shaped) const {
Size2 ret;
GDVIRTUAL_CALL(_shaped_text_get_size, p_shaped, ret);

View File

@ -486,8 +486,12 @@ public:
virtual Array shaped_text_get_objects(const RID &p_shaped) const override;
virtual Rect2 shaped_text_get_object_rect(const RID &p_shaped, const Variant &p_key) const override;
virtual Vector2i shaped_text_get_object_range(const RID &p_shaped, const Variant &p_key) const override;
virtual int64_t shaped_text_get_object_glyph(const RID &p_shaped, const Variant &p_key) const override;
GDVIRTUAL1RC(Array, _shaped_text_get_objects, RID);
GDVIRTUAL2RC(Rect2, _shaped_text_get_object_rect, RID, const Variant &);
GDVIRTUAL2RC(Vector2i, _shaped_text_get_object_range, RID, const Variant &);
GDVIRTUAL2RC(int64_t, _shaped_text_get_object_glyph, RID, const Variant &);
virtual Size2 shaped_text_get_size(const RID &p_shaped) const override;
virtual double shaped_text_get_ascent(const RID &p_shaped) const override;