Fix execution of physics picking events

Fix that physics picking can happen after the mouse has left the viewport
This commit is contained in:
Markus Sauermann 2022-02-27 23:57:51 +01:00
parent 61021c08f8
commit 90b01d79af

View file

@ -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);