瀏覽代碼

Merge pull request #98299 from timothyqiu/tree-coordinate

Fix button click detection when `Tree` is rotated
Thaddeus Crews 10 月之前
父節點
當前提交
b3bcb2dc14
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/gui/tree.cpp

+ 1 - 1
scene/gui/tree.cpp

@@ -3022,7 +3022,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, int
 				}
 
 				// Make sure the click is correct.
-				Point2 click_pos = get_global_mouse_position() - get_global_position();
+				const Point2 click_pos = get_local_mouse_position();
 				if (!get_item_at_position(click_pos)) {
 					pressed_button = -1;
 					cache.click_type = Cache::CLICK_NONE;