From ac7729b9ac0943490e1788bbc8621af1ba539b4e Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 4 Nov 2023 21:32:35 +0100 Subject: [PATCH] Fixed an issue where horizontally scrolling text containers sometimes had an incorrect vertical offset --- es-core/src/components/TextComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es-core/src/components/TextComponent.cpp b/es-core/src/components/TextComponent.cpp index 9087e7dc4..0f4dc1f95 100644 --- a/es-core/src/components/TextComponent.cpp +++ b/es-core/src/components/TextComponent.cpp @@ -472,7 +472,7 @@ void TextComponent::onTextChanged() float offsetY {0.0f}; if (mHorizontalScrolling) { - if (lineHeight > mSize.y) + if (lineHeight > mSize.y && mSize.y != 0.0f) offsetY = (mSize.y - lineHeight) / 2.0f; mTextCache = std::shared_ptr( font->buildTextCache(text, 0.0f, offsetY, mColor, mLineSpacing));