diff options
author | Markus Sauermann <6299227+Sauermann@users.noreply.github.com> | 2022-03-31 00:43:52 +0200 |
---|---|---|
committer | Markus Sauermann <6299227+Sauermann@users.noreply.github.com> | 2022-03-31 00:43:52 +0200 |
commit | 529e2279e14bd91e244488fbd3beef0075e63115 (patch) | |
tree | 0dddfcd7360473da9916ee6fd577023137074ef4 | |
parent | b7850bb1e8e235b60075b14a9b2ccf2dc0ce4a50 (diff) |
Fix Drag n Drop Transform in main embedding window
-rw-r--r-- | scene/main/viewport.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index e50197d5fa..a38bed71d1 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1851,8 +1851,10 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { } if (viewport_under) { - Transform2D ai = (viewport_under->get_final_transform().affine_inverse() * viewport_under->_get_input_pre_xform()); - viewport_pos = ai.xform(viewport_pos); + if (viewport_under != this) { + Transform2D ai = (viewport_under->get_final_transform().affine_inverse() * viewport_under->_get_input_pre_xform()); + viewport_pos = ai.xform(viewport_pos); + } // Find control under at position. gui.drag_mouse_over = viewport_under->gui_find_control(viewport_pos); if (gui.drag_mouse_over) { |