From e1d911f4011f3baa09a0ad18cf12dbdb048dca13 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 28 Oct 2022 21:31:40 +0200 Subject: [PATCH] Fixed an issue where text caches would not get cleared if the text was set to a blank value. --- es-core/src/components/TextComponent.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/es-core/src/components/TextComponent.cpp b/es-core/src/components/TextComponent.cpp index 687e758dd..be579fd3c 100644 --- a/es-core/src/components/TextComponent.cpp +++ b/es-core/src/components/TextComponent.cpp @@ -263,8 +263,11 @@ void TextComponent::onTextChanged() return; } - if (!mFont || text.empty() || mSize.x < 0.0f) + if (!mFont || text.empty() || mSize.x < 0.0f) { + if (mTextCache != nullptr) + mTextCache.reset(); return; + } float lineHeight {0.0f}; const bool isScrollable {mParent && mParent->isScrollable()};