summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-02-01 09:41:43 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-02-01 09:41:43 +0100
commitf7397a5ac6bffc0df24cae61b8aabfa4a3b65347 (patch)
tree08a928d1cb3972b3a9af2b26374c9314b9af99d8 /scene/main
parent9b0f194bbbc1098d5eaa20fb402927cce701c9ce (diff)
parent90b01d79af732b1906f13279f1cc928391d72557 (diff)
Merge pull request #58610 from Sauermann/fix-physics-mouse
Fix execution of physics picking events at unexpected times
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/viewport.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index fe82fed2f7..8412799f5d 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -527,6 +527,11 @@ void Viewport::_process_picking() {
if (to_screen_rect != Rect2i() && Input::get_singleton()->get_mouse_mode() == Input::MOUSE_MODE_CAPTURED) {
return;
}
+ if (!gui.mouse_in_viewport) {
+ // Clear picking events if mouse has left viewport.
+ physics_picking_events.clear();
+ return;
+ }
_drop_physics_mouseover(true);