fix: Fix alignment of multiline vertically centered text

This commit is contained in:
Vsevolod Kremianskii 2021-01-26 21:25:29 +07:00
parent 8303e79689
commit c266e39c41

View file

@ -496,7 +496,7 @@ void Control::getTextPosition(glm::ivec2 &position, int lineCount, const glm::iv
case TextAlign::LeftCenter2:
case TextAlign::CenterCenter:
default:
position.y = _extent.top + size.y / 2;
position.y = _extent.top + size.y / 2 - static_cast<int>(glm::max(0, (lineCount - 2)) * _text.font->height());
break;
}
// Horizontal alignment