Skip to content

Commit ef16b6b

Browse files
authored
Fix: [ui::Text] Overflow::SHRINK does not restore the original font size when text is shortened (#2831)
1 parent e3672be commit ef16b6b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/2d/Label.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2574,6 +2574,9 @@ const Vec2& Label::getContentSize() const
25742574
{
25752575
if (_systemFontDirty || _contentDirty)
25762576
{
2577+
if (_overflow == Overflow::SHRINK && this->getRenderingFontSize() < _originalFontSize)
2578+
const_cast<Label*>(this)->rescaleWithOriginalFontSize();
2579+
25772580
const_cast<Label*>(this)->updateContent();
25782581
}
25792582
return _contentSize;

0 commit comments

Comments
 (0)