Eliminated some unnecessary processing in TextComponent.

This commit is contained in:
Leon Styhre 2021-01-13 19:49:35 +01:00
parent 34e10ec319
commit a97b08e87e

View file

@ -229,7 +229,7 @@ void TextComponent::onTextChanged()
}
Vector2f size = f->sizeText(text);
if (!isMultiline && mSize.x() && text.size() && (size.x() > mSize.x() || addAbbrev)) {
if (!isMultiline && mSize.x() > 0.0f && text.size() && (size.x() > mSize.x() || addAbbrev)) {
// Abbreviate text.
const std::string abbrev = "...";
Vector2f abbrevSize = f->sizeText(abbrev);