From 539e071afae6d321eef0eb0c0fd8ad81fc4d856e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 18 Mar 2025 13:47:17 +0100 Subject: [PATCH] Revert "Fix SceneTree's rename LineEdit's offset position" This reverts commit 87f75e77850ea8015452fecfca92c202d640895a. This caused a regression (#104138) so let's wait for it to be properly resolved and tested before attempting a cherry-pick. --- scene/gui/tree.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index dc14294ea0..af36b20132 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -4107,18 +4107,13 @@ bool Tree::edit_selected(bool p_force_edit) { // "floor()" centers vertically. Vector2 ofs(0, Math::floor((MAX(line_editor->get_minimum_size().height, rect.size.height - value_editor_height) - rect.size.height) / 2)); + popup_rect.position = get_screen_position() + rect.position - ofs; + popup_rect.size = rect.size; + // Account for icon. Size2 icon_size = _get_cell_icon_size(c) * popup_scale; - - popup_rect.size = rect.size; - popup_rect.size.x -= icon_size.x + theme_cache.h_separation; - - popup_rect.position = rect.position - ofs; - popup_rect.position.x += icon_size.x + theme_cache.h_separation; - if (cache.rtl) { - popup_rect.position.x = get_size().width - popup_rect.position.x - popup_rect.size.x; - } - popup_rect.position += get_screen_position(); + popup_rect.position.x += icon_size.x; + popup_rect.size.x -= icon_size.x; line_editor->clear(); line_editor->set_text(c.mode == TreeItem::CELL_MODE_STRING ? c.text : String::num(c.val, Math::range_step_decimals(c.step)));