Merge pull request #58610 from Sauermann/fix-physics-mouse

Fix execution of physics picking events at unexpected times
This commit is contained in:
Rémi Verschelde 2023-02-01 09:41:43 +01:00
commit f7397a5ac6
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -527,6 +527,11 @@ void Viewport::_process_picking() {
if (to_screen_rect != Rect2i() && Input::get_singleton()->get_mouse_mode() == Input::MOUSE_MODE_CAPTURED) { if (to_screen_rect != Rect2i() && Input::get_singleton()->get_mouse_mode() == Input::MOUSE_MODE_CAPTURED) {
return; return;
} }
if (!gui.mouse_in_viewport) {
// Clear picking events if mouse has left viewport.
physics_picking_events.clear();
return;
}
_drop_physics_mouseover(true); _drop_physics_mouseover(true);