From 57a821e717c78e50cce9ef8949402431857b53a6 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 1 Sep 2024 10:56:31 +0200 Subject: [PATCH] Fixed a regression where horizontal text containers would sometimes not work correctly --- es-core/src/components/TextComponent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/es-core/src/components/TextComponent.cpp b/es-core/src/components/TextComponent.cpp index f19820b52..e608168a2 100644 --- a/es-core/src/components/TextComponent.cpp +++ b/es-core/src/components/TextComponent.cpp @@ -489,7 +489,8 @@ void TextComponent::onTextChanged() (mSize.y - lineHeight) / 2.0f : 0.0f)}; - const float length {mAutoCalcExtent.x ? 0.0f : mSize.x * mRelativeScale}; + const float length {mAutoCalcExtent.x || mHorizontalScrolling ? 0.0f : + mSize.x * mRelativeScale}; const float height {mAutoCalcExtent.y ? 0.0f : (mSize.y * mRelativeScale) - lineHeight}; const Alignment horizontalAlignment {mHorizontalScrolling ? ALIGN_LEFT : mHorizontalAlignment}; const bool multiLine {mAutoCalcExtent.y == 1 || mSize.y > lineHeight};