瀏覽代碼

-fix clip+center alignment on Button, fixes #1865

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

+ 2 - 0
scene/gui/button.cpp

@@ -115,6 +115,8 @@ void Button::_notification(int p_what) {
 				text_ofs.y+=style->get_offset().y;
 				text_ofs.y+=style->get_offset().y;
 			} break;
 			} break;
 			case ALIGN_CENTER: {
 			case ALIGN_CENTER: {
+				if (text_ofs.x<0)
+					text_ofs.x=0;
 				text_ofs+=icon_ofs;
 				text_ofs+=icon_ofs;
 				text_ofs+=style->get_offset();
 				text_ofs+=style->get_offset();
 			} break;
 			} break;