Fixed a regression where horizontal text containers would sometimes not work correctly

This commit is contained in:
Leon Styhre 2024-09-01 10:56:31 +02:00
parent 18eade57ad
commit 57a821e717

View file

@ -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};