The text cache is now always reset on text changes.

This commit is contained in:
Leon Styhre 2022-11-03 12:09:19 +01:00
parent 3ead13ad29
commit b426473ec0

View file

@ -240,6 +240,8 @@ void TextComponent::render(const glm::mat4& parentTrans)
void TextComponent::onTextChanged() void TextComponent::onTextChanged()
{ {
mTextCache.reset();
if (!mVerticalAutoSizing) if (!mVerticalAutoSizing)
mVerticalAutoSizing = (mSize.x != 0.0f && mSize.y == 0.0f); mVerticalAutoSizing = (mSize.x != 0.0f && mSize.y == 0.0f);
@ -264,8 +266,6 @@ void TextComponent::onTextChanged()
} }
if (!mFont || text.empty() || mSize.x < 0.0f) { if (!mFont || text.empty() || mSize.x < 0.0f) {
if (mTextCache != nullptr)
mTextCache.reset();
return; return;
} }