diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-07-02 07:21:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-02 07:21:24 +0200 |
commit | b11da7b703931b0ade8181c5bae5e4b0a1c0b4d7 (patch) | |
tree | 9e3dbe07cb36a861f9c2237305dee5772063f64e | |
parent | 1ae40793c78ba9ab84d102772bb271c91a492568 (diff) | |
parent | f0e320decf0be85eddb262b63541ae55354d257c (diff) |
Merge pull request #40028 from reduz/fix-popups1
Fix some popup menus missing screen transform.
-rw-r--r-- | editor/filesystem_dock.cpp | 2 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 2 | ||||
-rw-r--r-- | editor/scene_tree_editor.cpp | 2 | ||||
-rw-r--r-- | scene/gui/line_edit.cpp | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index e1f55bd8a8..133aa39cd3 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -2313,7 +2313,7 @@ void FileSystemDock::_tree_rmb_select(const Vector2 &p_pos) { tree_popup->clear(); tree_popup->set_size(Size2(1, 1)); _file_and_folders_fill_popup(tree_popup, paths); - tree_popup->set_position(tree->get_global_position() + p_pos); + tree_popup->set_position(tree->get_screen_position() + p_pos); tree_popup->popup(); } } diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 9831f1bd31..b8ac405f53 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -2399,7 +2399,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { } menu->set_size(Size2(1, 1)); - menu->set_position(p_menu_pos); + menu->set_position(get_screen_position() + p_menu_pos); menu->popup(); return; } diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 1b818036e1..6f29633188 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -1072,7 +1072,7 @@ void SceneTreeEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, } void SceneTreeEditor::_rmb_select(const Vector2 &p_pos) { - emit_signal("rmb_pressed", tree->get_global_transform().xform(p_pos)); + emit_signal("rmb_pressed", tree->get_screen_transform().xform(p_pos)); } void SceneTreeEditor::_warning_changed(Node *p_for_node) { diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 251f31ce4e..27c2c70708 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -51,7 +51,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) { if (b.is_valid()) { if (b->is_pressed() && b->get_button_index() == BUTTON_RIGHT && context_menu_enabled) { - menu->set_position(get_global_transform().xform(get_local_mouse_position())); + menu->set_position(get_screen_transform().xform(get_local_mouse_position())); menu->set_size(Vector2(1, 1)); //menu->set_scale(get_global_transform().get_scale()); menu->popup(); |