Skip to content

Commit f53a220

Browse files
committed
Fix physics picking when hovering an embedded window
When the mouse is hovering an embedded window, it is still considered within the main viewport. Previously in this case physics picking was executed, as if no embedded window was there. This PR introduces an additional check to exclude these cases.
1 parent f128f38 commit f53a220

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scene/main/viewport.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,8 +682,9 @@ void Viewport::_process_picking() {
682682
if (Object::cast_to<Window>(this) && Input::get_singleton()->get_mouse_mode() == Input::MOUSE_MODE_CAPTURED) {
683683
return;
684684
}
685-
if (!gui.mouse_in_viewport) {
686-
// Clear picking events if mouse has left viewport.
685+
if (!gui.mouse_in_viewport || gui.subwindow_over) {
686+
// Clear picking events if the mouse has left the viewport or is over an embedded window.
687+
// These are locations, that are expected to not trigger physics picking.
687688
physics_picking_events.clear();
688689
return;
689690
}

0 commit comments

Comments
 (0)