Explorar el Código

Merge pull request #53038 from pycbouh/tree-fix-folding-arrow-with-margin

Correctly calculate position of the folding arrow in `Tree`
Rémi Verschelde hace 4 años
padre
commit
9c13e9152f
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      scene/gui/tree.cpp

+ 2 - 1
scene/gui/tree.cpp

@@ -1968,7 +1968,8 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
 				arrow = cache.arrow;
 				arrow = cache.arrow;
 			}
 			}
 
 
-			Point2 apos = p_pos + p_draw_ofs + Point2i(0, (label_h - arrow->get_height()) / 2) - cache.offset;
+			Point2 apos = p_pos + Point2i(0, (label_h - arrow->get_height()) / 2) - cache.offset + p_draw_ofs;
+			apos.x += cache.item_margin - arrow->get_width();
 
 
 			if (rtl) {
 			if (rtl) {
 				apos.x = get_size().width - apos.x - arrow->get_width();
 				apos.x = get_size().width - apos.x - arrow->get_width();