From 81efebb3a170dd6194905599361c38ae4246c434 Mon Sep 17 00:00:00 2001 From: jmb462 Date: Tue, 31 Aug 2021 17:43:35 +0200 Subject: Fix bad popups offset in editor with single window off Co-authored-by: Gil Arasa Verge Co-authored-by: Tomasz Chabora --- scene/gui/line_edit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scene/gui/line_edit.cpp') diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 30a6f0fc9a..3b39eaea02 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -227,7 +227,7 @@ void LineEdit::gui_input(const Ref &p_event) { } if (b->is_pressed() && b->get_button_index() == MouseButton::RIGHT && context_menu_enabled) { _ensure_menu(); - menu->set_position(get_screen_transform().xform(get_local_mouse_position())); + menu->set_position(get_screen_position() + get_local_mouse_position()); menu->reset_size(); menu->popup(); grab_focus(); @@ -392,7 +392,7 @@ void LineEdit::gui_input(const Ref &p_event) { if (k->is_action("ui_menu", true)) { _ensure_menu(); Point2 pos = Point2(get_caret_pixel_pos().x, (get_size().y + get_theme_font(SNAME("font"))->get_height(get_theme_font_size(SNAME("font_size")))) / 2); - menu->set_position(get_global_transform().xform(pos)); + menu->set_position(get_screen_position() + pos); menu->reset_size(); menu->popup(); menu->grab_focus(); -- cgit v1.2.3