From 18978881fef542f47b4bc34508ef21607f35f49e Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Thu, 3 Nov 2022 23:57:07 +0100 Subject: Code simplifications CanvasItemEditor: - p_result == ADD_MOVE is always true in this switch-clause - both parts of the if-else-clause do the same thing and simplified an affine_inverse call ControlEditorToolbar: - private function ControlEditorToolbar::_anchor_to_position is used nowhere. Looks like copy and paste from CanvasItemEditor::_anchor_to_position ScrollContainer: - screen_is_touchscreen is always true, because otherwise the function already returned TextLine: - both parts of the if-else-clause do the same thing and simplified return statement --- scene/resources/text_line.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'scene/resources') diff --git a/scene/resources/text_line.cpp b/scene/resources/text_line.cpp index ca1cd54349..afab44834d 100644 --- a/scene/resources/text_line.cpp +++ b/scene/resources/text_line.cpp @@ -317,11 +317,7 @@ float TextLine::get_width() const { Size2 TextLine::get_size() const { const_cast(this)->_shape(); - 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); } float TextLine::get_line_ascent() const { -- cgit v1.2.3