diff --git a/editor/import/dynamic_font_import_settings.cpp b/editor/import/dynamic_font_import_settings.cpp index 39e4ffbc16a..1ee795f7d8a 100644 --- a/editor/import/dynamic_font_import_settings.cpp +++ b/editor/import/dynamic_font_import_settings.cpp @@ -858,7 +858,7 @@ bool DynamicFontImportSettings::_char_update(int32_t p_char) { if (import_variation_data->selected_chars.has(p_char)) { import_variation_data->selected_chars.erase(p_char); return false; - } else if (font_main.is_valid() && font_main.is_valid() && import_variation_data->selected_glyphs.has(font_main->get_glyph_index(16, p_char))) { + } else if (font_main.is_valid() && import_variation_data->selected_glyphs.has(font_main->get_glyph_index(16, p_char))) { import_variation_data->selected_glyphs.erase(font_main->get_glyph_index(16, p_char)); return false; } else { @@ -1083,7 +1083,7 @@ void DynamicFontImportSettings::open_settings(const String &p_path) { font_preview_label->set_text(sample); Ref bold_font = get_theme_font(SNAME("bold"), SNAME("EditorFonts")); - if (bold_font.is_valid() && bold_font.is_valid()) { + if (bold_font.is_valid()) { font_name_label->add_theme_font_override("bold_font", bold_font); } font_name_label->set_text(font_name); diff --git a/scene/resources/text_paragraph.cpp b/scene/resources/text_paragraph.cpp index 33f11371fe6..dbf595cb29e 100644 --- a/scene/resources/text_paragraph.cpp +++ b/scene/resources/text_paragraph.cpp @@ -525,11 +525,7 @@ Size2 TextParagraph::get_non_wrapped_size() const { _THREAD_SAFE_METHOD_ const_cast(this)->_shape_lines(); - if (TS->shaped_text_get_orientation(rid) == TextServer::ORIENTATION_HORIZONTAL) { - return Size2(TS->shaped_text_get_size(rid).x, TS->shaped_text_get_size(rid).y); - } else { - return Size2(TS->shaped_text_get_size(rid).x, TS->shaped_text_get_size(rid).y); - } + return TS->shaped_text_get_size(rid); } Size2 TextParagraph::get_size() const { @@ -675,11 +671,7 @@ Size2 TextParagraph::get_line_size(int p_line) const { const_cast(this)->_shape_lines(); ERR_FAIL_COND_V(p_line < 0 || p_line >= (int)lines_rid.size(), Size2()); - if (TS->shaped_text_get_orientation(lines_rid[p_line]) == TextServer::ORIENTATION_HORIZONTAL) { - return Size2(TS->shaped_text_get_size(lines_rid[p_line]).x, TS->shaped_text_get_size(lines_rid[p_line]).y); - } else { - return Size2(TS->shaped_text_get_size(lines_rid[p_line]).x, TS->shaped_text_get_size(lines_rid[p_line]).y); - } + return TS->shaped_text_get_size(lines_rid[p_line]); } Vector2i TextParagraph::get_line_range(int p_line) const {