You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Merge pull request #7060 from volzhs/label-valign
Fix Label valign position
This commit is contained in:
@@ -118,19 +118,19 @@ void Label::_notification(int p_what) {
|
|||||||
//nothing
|
//nothing
|
||||||
} break;
|
} break;
|
||||||
case VALIGN_CENTER: {
|
case VALIGN_CENTER: {
|
||||||
vbegin=(size.y - lines_visible * font_h) / 2;
|
vbegin=(size.y - (lines_visible * font_h - line_spacing)) / 2;
|
||||||
vsep=0;
|
vsep=0;
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case VALIGN_BOTTOM: {
|
case VALIGN_BOTTOM: {
|
||||||
vbegin=size.y - lines_visible * font_h;
|
vbegin=size.y - (lines_visible * font_h - line_spacing);
|
||||||
vsep=0;
|
vsep=0;
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case VALIGN_FILL: {
|
case VALIGN_FILL: {
|
||||||
vbegin=0;
|
vbegin=0;
|
||||||
if (lines_visible>1) {
|
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 {
|
} else {
|
||||||
vsep=0;
|
vsep=0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user