Skip to content

Commit

Permalink
Enable SubViewportContainer as a potential candidate for dropping i…
Browse files Browse the repository at this point in the history
…n Drag&Drop

When no Control node inside of a `SubViewport` is currently hovered, then
the `SubViewportContainer` should be available as a potential Drop-target.
  • Loading branch information
Sauermann committed Nov 13, 2024
1 parent 76fa7b2 commit 658742a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scene/main/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3062,6 +3062,13 @@ void Viewport::_update_mouse_over(Vector2 p_pos) {
}
v->_update_mouse_over(v->get_final_transform().affine_inverse().xform(pos));
}

Viewport *section_root = get_section_root_viewport();
if (section_root && !section_root->gui.target_control) {
// In the case that no control nodes were found within SubViewports at the position of the mouse cursor,
// ensure, that the current SubViewportContainer is considered for the Control node, that the mouse is over.
section_root->gui.target_control = over;
}
}
}

Expand Down

0 comments on commit 658742a

Please sign in to comment.