diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-10-01 15:24:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-01 15:24:52 +0200 |
commit | 928c002f223b67bd6fd1c55d65e37a6d5c4e3a94 (patch) | |
tree | 9b0ea4d9718fe694b2b22d9e09a66b32db8c2cb9 /editor | |
parent | 06c1b40b84645b4460dd49d95694a7779d636f92 (diff) | |
parent | 0c0b5c84b06e64de6cab301994ac9cd1f845dd35 (diff) |
Merge pull request #52192 from bruvzg/text_server_gdext
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_spin_slider.cpp | 5 | ||||
-rw-r--r-- | editor/import/dynamicfont_import_settings.cpp | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index 1890814da9..ec90af1bcc 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -330,9 +330,8 @@ void EditorSpinSlider::_draw_spin_slider() { float text_start = rtl ? Math::round(sb->get_offset().x) : Math::round(sb->get_offset().x + label_width + sep); Vector2 text_ofs = rtl ? Vector2(text_start + (number_width - TS->shaped_text_get_width(num_rid)), vofs) : Vector2(text_start, vofs); - const Vector<TextServer::Glyph> visual = TS->shaped_text_get_glyphs(num_rid); - int v_size = visual.size(); - const TextServer::Glyph *glyphs = visual.ptr(); + int v_size = TS->shaped_text_get_glyph_count(num_rid); + const Glyph *glyphs = TS->shaped_text_get_glyphs(num_rid); for (int i = 0; i < v_size; i++) { for (int j = 0; j < glyphs[i].repeat; j++) { if (text_ofs.x >= text_start && (text_ofs.x + glyphs[i].advance) <= (text_start + number_width)) { diff --git a/editor/import/dynamicfont_import_settings.cpp b/editor/import/dynamicfont_import_settings.cpp index 9a8abfa5c6..474c9d5296 100644 --- a/editor/import/dynamicfont_import_settings.cpp +++ b/editor/import/dynamicfont_import_settings.cpp @@ -1011,9 +1011,10 @@ void DynamicFontImportSettings::_glyph_text_selected() { if (text_rid.is_valid()) { TS->shaped_text_add_string(text_rid, text_edit->get_text(), font_main->get_rids(), 16, ftrs, text_edit->get_language()); TS->shaped_text_shape(text_rid); - const Vector<TextServer::Glyph> &gl = TS->shaped_text_get_glyphs(text_rid); + const Glyph *gl = TS->shaped_text_get_glyphs(text_rid); + const int gl_size = TS->shaped_text_get_glyph_count(text_rid); - for (int i = 0; i < gl.size(); i++) { + for (int i = 0; i < gl_size; i++) { if (gl[i].font_rid.is_valid() && gl[i].index != 0) { selected_glyphs.insert(gl[i].index); } |