[fix]The problem of inaccurate maximum width limit when using system fonts.

This commit is contained in:
榆柳松 2021-09-02 17:12:12 +08:00
parent d197e8b245
commit 1548c75a3d
1 changed files with 1 additions and 1 deletions

View File

@ -2391,7 +2391,7 @@ FontDefinition Label::_getFontDefinition() const
systemFontDef._fontSize = _systemFontSize;
systemFontDef._alignment = _hAlignment;
systemFontDef._vertAlignment = _vAlignment;
systemFontDef._dimensions.width = _labelWidth;
systemFontDef._dimensions.width = _labelWidth == 0.f ? _maxLineWidth : _labelWidth;
systemFontDef._dimensions.height = _labelHeight;
systemFontDef._fontFillColor.r = _textColor.r;
systemFontDef._fontFillColor.g = _textColor.g;