1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

[TextServer] Improve embedded objects handling performance.

This commit is contained in:
bruvzg
2024-09-26 09:37:47 +03:00
committed by Pāvels Nadtočajevs
parent 4cf02312f6
commit cc1db569e1
15 changed files with 242 additions and 89 deletions

View File

@@ -489,6 +489,8 @@ class TextServerAdvanced : public TextServerExtension {
Variant meta;
};
Vector<Span> spans;
int first_span = 0; // First span in the parent ShapedTextData.
int last_span = 0;
struct EmbeddedObject {
int start = -1;
@@ -957,6 +959,7 @@ public:
MODBIND1RC(int64_t, shaped_get_span_count, const RID &);
MODBIND2RC(Variant, shaped_get_span_meta, const RID &, int64_t);
MODBIND2RC(Variant, shaped_get_span_embedded_object, const RID &, int64_t);
MODBIND5(shaped_set_span_update_font, const RID &, int64_t, const TypedArray<RID> &, int64_t, const Dictionary &);
MODBIND3RC(RID, shaped_text_substr, const RID &, int64_t, int64_t);