summaryrefslogtreecommitdiffstats
path: root/scene/main
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/viewport.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index e70407f36e..9b27a28831 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -3062,6 +3062,14 @@ void Viewport::_update_mouse_over(Vector2 p_pos) {
}
v->_update_mouse_over(v->get_final_transform().affine_inverse().xform(pos));
}
+
+ Viewport *section_root = get_section_root_viewport();
+ if (section_root && c->is_consume_drag_and_drop_enabled()) {
+ // Evaluating `consume_drag_and_drop` and adjusting target_control needs to happen
+ // after `_update_mouse_over` in the SubViewports, because otherwise physics picking
+ // would not work inside SubViewports.
+ section_root->gui.target_control = over;
+ }
}
}