瀏覽代碼

Fix Label valign position

Fix #7055

(cherry picked from commit c0e87f2a248af48b22f414ecc00df2631a715eac)
volzhs 8 年之前
父節點
當前提交
36a4c54593
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      scene/gui/label.cpp

+ 3 - 3
scene/gui/label.cpp

@@ -118,19 +118,19 @@ void Label::_notification(int p_what) {
 					//nothing
 				} break;
 				case VALIGN_CENTER: {
-					vbegin=(size.y - lines_visible * font_h) / 2;
+					vbegin=(size.y - (lines_visible * font_h - line_spacing)) / 2;
 					vsep=0;
 
 				} break;
 				case VALIGN_BOTTOM: {
-					vbegin=size.y - lines_visible * font_h;
+					vbegin=size.y - (lines_visible * font_h - line_spacing);
 					vsep=0;
 
 				} break;
 				case VALIGN_FILL: {
 					vbegin=0;
 					if (lines_visible>1) {
-						vsep=(size.y - lines_visible * font_h) / (lines_visible - 1);
+						vsep=(size.y - (lines_visible * font_h - line_spacing)) / (lines_visible - 1);
 					} else {
 						vsep=0;
 					}