Skip to content

Commit 1764269

Browse files
committed
Fix button click detection when Tree is rotated
1 parent 4631a61 commit 1764269

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scene/gui/tree.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2978,7 +2978,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, int
29782978
}
29792979

29802980
// Make sure the click is correct.
2981-
Point2 click_pos = get_global_mouse_position() - get_global_position();
2981+
const Point2 click_pos = get_local_mouse_position();
29822982
if (!get_item_at_position(click_pos)) {
29832983
pressed_button = -1;
29842984
cache.click_type = Cache::CLICK_NONE;

0 commit comments

Comments
 (0)