summaryrefslogtreecommitdiffstats
path: root/scene/main/viewport.cpp
diff options
context:
space:
mode:
authorGeorge L. Albany <Megacake1234@gmail.com>2024-11-26 19:30:58 +0000
committerGitHub <noreply@github.com>2024-11-26 19:30:58 +0000
commitb06d20bf39d15ec736d08d4e4fcb32e0c3c1ce1e (patch)
tree79c2a4c34f2d888ff962d76edf474c518d1abdea /scene/main/viewport.cpp
parentc5b1645e60a59c0292c04bece3fdb0715a61afea (diff)
parente58e18261ea7ed3978146ef8d77a900be2601be3 (diff)
downloadredot-engine-b06d20bf39d15ec736d08d4e4fcb32e0c3c1ce1e.tar.gz
Merge pull request #885 from Spartan322/merge/d09d82d
Merge commit godotengine/godot@d09d82d
Diffstat (limited to 'scene/main/viewport.cpp')
-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 dabd1dbe07..f66d39dbad 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -3067,6 +3067,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;
+ }
}
}