mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 07:35:38 +00:00
Fixed an issue where horizontally scrolling text containers sometimes had an incorrect vertical offset
This commit is contained in:
parent
d7da0a768b
commit
ac7729b9ac
|
@ -472,7 +472,7 @@ void TextComponent::onTextChanged()
|
||||||
float offsetY {0.0f};
|
float offsetY {0.0f};
|
||||||
|
|
||||||
if (mHorizontalScrolling) {
|
if (mHorizontalScrolling) {
|
||||||
if (lineHeight > mSize.y)
|
if (lineHeight > mSize.y && mSize.y != 0.0f)
|
||||||
offsetY = (mSize.y - lineHeight) / 2.0f;
|
offsetY = (mSize.y - lineHeight) / 2.0f;
|
||||||
mTextCache = std::shared_ptr<TextCache>(
|
mTextCache = std::shared_ptr<TextCache>(
|
||||||
font->buildTextCache(text, 0.0f, offsetY, mColor, mLineSpacing));
|
font->buildTextCache(text, 0.0f, offsetY, mColor, mLineSpacing));
|
||||||
|
|
Loading…
Reference in a new issue