Fixed an issue where text caches would not get cleared if the text was set to a blank value.

This commit is contained in:
Leon Styhre 2022-10-28 21:31:40 +02:00
parent 27936131f3
commit e1d911f401

View file

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