浏览代码

Merge pull request #108401 from DanielGSilva/tree-guides

Draw guide lines over selection and focus styleboxes
Thaddeus Crews 2 月之前
父节点
当前提交
02540477fd
共有 1 个文件被更改,包括 8 次插入8 次删除
  1. 8 8
      scene/gui/tree.cpp

+ 8 - 8
scene/gui/tree.cpp

@@ -2314,14 +2314,6 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
 				cell_rect.size.x += theme_cache.h_separation;
 			}
 
-			if (theme_cache.draw_guides) {
-				Rect2 r = cell_rect;
-				if (rtl) {
-					r.position.x = get_size().width - r.position.x - r.size.x;
-				}
-				RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(r.position.x, r.position.y + r.size.height), r.position + r.size, theme_cache.guide_color, 1);
-			}
-
 			if (i == 0 && select_mode == SELECT_ROW) {
 				if (p_item->cells[0].selected || is_row_hovered) {
 					const Rect2 content_rect = _get_content_rect();
@@ -2398,6 +2390,14 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
 				}
 			}
 
+			if (theme_cache.draw_guides) {
+				Rect2 r = cell_rect;
+				if (rtl) {
+					r.position.x = get_size().width - r.position.x - r.size.x;
+				}
+				RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2i(r.position.x, r.position.y + r.size.height), r.position + r.size, theme_cache.guide_color, 1);
+			}
+
 			if (p_item->cells[i].custom_bg_color) {
 				Rect2 r = cell_rect;
 				if (i == 0) {