Browse Source

Merge pull request #15121 from yanorax/treeitem_set_text_align_fix

Fix TreeItem cell text alignment
Noshyaar 7 years ago
parent
commit
45612f1657
1 changed files with 2 additions and 2 deletions
  1. 2 2
      scene/gui/tree.cpp

+ 2 - 2
scene/gui/tree.cpp

@@ -1009,10 +1009,10 @@ void Tree::draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, co
 		case TreeItem::ALIGN_LEFT:
 			break; //do none
 		case TreeItem::ALIGN_CENTER:
-			rect.position.x = MAX(0, (rect.size.width - w) / 2);
+			rect.position.x += MAX(0, (rect.size.width - w) / 2);
 			break; //do none
 		case TreeItem::ALIGN_RIGHT:
-			rect.position.x = MAX(0, (rect.size.width - w));
+			rect.position.x += MAX(0, (rect.size.width - w));
 			break; //do none
 	}