瀏覽代碼

Fix button multiline text alignment.

bruvzg 3 年之前
父節點
當前提交
c89ee71297
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      scene/gui/button.cpp

+ 2 - 0
scene/gui/button.cpp

@@ -302,6 +302,8 @@ void Button::_notification(int p_what) {
 
 			Point2 text_ofs = (size - style->get_minimum_size() - icon_ofs - text_buf->get_size() - Point2(_internal_margin[SIDE_RIGHT] - _internal_margin[SIDE_LEFT], 0)) / 2.0;
 
+			text_buf->set_alignment(align_rtl_checked);
+			text_buf->set_width(text_width);
 			switch (align_rtl_checked) {
 				case HORIZONTAL_ALIGNMENT_FILL:
 				case HORIZONTAL_ALIGNMENT_LEFT: {