mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +00:00
Fixed an issue where horizontally scrolling text was not always rendered correctly when scrolling was reset
This commit is contained in:
parent
68ba299e0e
commit
847874a149
|
@ -378,9 +378,14 @@ void TextComponent::setHorizontalScrolling(bool state)
|
||||||
resetComponent();
|
resetComponent();
|
||||||
mHorizontalScrolling = state;
|
mHorizontalScrolling = state;
|
||||||
|
|
||||||
if (mHorizontalScrolling)
|
if (mHorizontalScrolling) {
|
||||||
mScrollSpeed =
|
mScrollSpeed =
|
||||||
mFont->sizeText("ABCDEFGHIJKLMNOPQRSTUVWXYZ").x * 0.247f * mScrollSpeedMultiplier;
|
mFont->sizeText("ABCDEFGHIJKLMNOPQRSTUVWXYZ").x * 0.247f * mScrollSpeedMultiplier;
|
||||||
|
}
|
||||||
|
else if (mTextCache != nullptr) {
|
||||||
|
mTextCache->setClipRegion(
|
||||||
|
glm::vec4 {0.0f, 0.0f, mSize.x * mRelativeScale, mTextCache->metrics.size.y});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextComponent::update(int deltaTime)
|
void TextComponent::update(int deltaTime)
|
||||||
|
|
Loading…
Reference in a new issue