summaryrefslogtreecommitdiff
path: root/scene/gui/line_edit.cpp
diff options
context:
space:
mode:
authorjmb462 <jmb462@gmail.com>2021-08-31 17:43:35 +0200
committerRĂ©mi Verschelde <rverschelde@gmail.com>2021-12-06 14:29:48 +0100
commit81efebb3a170dd6194905599361c38ae4246c434 (patch)
tree0dc5df12b8df69c2272836bfbb66bbb30037a709 /scene/gui/line_edit.cpp
parentede7614fe2e088f9ece1e1aba5cb3d5fceb476e4 (diff)
Fix bad popups offset in editor with single window off
Co-authored-by: Gil Arasa Verge <gilarasaverge@gmail.com> Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
Diffstat (limited to 'scene/gui/line_edit.cpp')
-rw-r--r--scene/gui/line_edit.cpp4
1 files changed, 2 insertions, 2 deletions
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<InputEvent> &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<InputEvent> &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();