Fix execution of physics picking events
Fix that physics picking can happen after the mouse has left the viewport
This commit is contained in:
parent
61021c08f8
commit
90b01d79af
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue