소스 검색

Merge pull request #98300 from timothyqiu/tree-coordinate-3.x

[3.x] Fix button click detection when `Tree` is rotated
lawnjelly 10 달 전
부모
커밋
e8b4fe3c91
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;