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

Revert "Fix SceneTree's rename LineEdit's offset position"

This reverts commit 87f75e7785.

This caused a regression (#104138) so let's wait for it to be properly
resolved and tested before attempting a cherry-pick.
This commit is contained in:
Rémi Verschelde
2025-03-18 13:47:17 +01:00
parent 74cbb2152b
commit 539e071afa

View File

@@ -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)));