diff options
author | Markus Sauermann <6299227+Sauermann@users.noreply.github.com> | 2022-02-27 23:57:51 +0100 |
---|---|---|
committer | Markus Sauermann <6299227+Sauermann@users.noreply.github.com> | 2022-10-06 13:58:54 +0200 |
commit | 90b01d79af732b1906f13279f1cc928391d72557 (patch) | |
tree | 94cf588dd104eee4f488cdf9e9d80b29a620a246 | |
parent | 61021c08f80856f8d99dfbe9fd3d338ef5f41999 (diff) |
Fix execution of physics picking events
Fix that physics picking can happen after the mouse has left the viewport
-rw-r--r-- | scene/main/viewport.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 234cebd821..d5371ae6a7 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -519,6 +519,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); |