From b426473ec01a8435d0c0d7e6e0e4706c3c0a8791 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Thu, 3 Nov 2022 12:09:19 +0100 Subject: [PATCH] The text cache is now always reset on text changes. --- es-core/src/components/TextComponent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/es-core/src/components/TextComponent.cpp b/es-core/src/components/TextComponent.cpp index be579fd3c..fcab0a511 100644 --- a/es-core/src/components/TextComponent.cpp +++ b/es-core/src/components/TextComponent.cpp @@ -240,6 +240,8 @@ void TextComponent::render(const glm::mat4& parentTrans) void TextComponent::onTextChanged() { + mTextCache.reset(); + if (!mVerticalAutoSizing) 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 (mTextCache != nullptr) - mTextCache.reset(); return; }