Skip to content

Commit

Permalink
Don't return Tree items outside visible rect
Browse files Browse the repository at this point in the history
  • Loading branch information
KoBeWi committed Jan 31, 2025
1 parent 1586c56 commit ac9f483
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scene/gui/tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5708,6 +5708,10 @@ Variant Tree::get_drag_data(const Point2 &p_point) {
}

TreeItem *Tree::get_item_at_position(const Point2 &p_pos) const {
if (!Rect2(get_position(), get_size()).has_point(p_pos)) {
return nullptr;
}

if (root) {
Point2 pos = p_pos;
if (is_layout_rtl()) {
Expand Down

0 comments on commit ac9f483

Please sign in to comment.