浏览代码

Fix button click detection when `Tree` is rotated

(cherry picked from commit 93c514600b71c28a72f67441ce288645400643a0)
Haoyu Qiu 11 月之前
父节点
当前提交
4205412c7e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/gui/tree.cpp

+ 1 - 1
scene/gui/tree.cpp

@@ -1722,7 +1722,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
 				cache.click_id = c.buttons[j].id;
 				cache.click_item = p_item;
 				cache.click_column = col;
-				cache.click_pos = get_global_mouse_position() - get_global_position();
+				cache.click_pos = get_local_mouse_position();
 				update();
 				//emit_signal("button_pressed");
 				return -1;