Merge pull request #490 from wzhengsen/dev

[fix]The problem of inaccurate maximum width limit when using system fonts.
This commit is contained in:
halx99 2021-09-02 17:48:42 +08:00 committed by GitHub
commit 96e83c9cf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;