diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index ede619ef3a..4d90072e29 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -840,14 +840,14 @@ bool Label::updateQuads() _reusedRect.size.height -= clipTop; py -= clipTop; } - if (py - letterDef.height < _tailoredBottomY) + if (py - letterDef.height * _bmfontScale < _tailoredBottomY) { _reusedRect.size.height = (py < _tailoredBottomY) ? 0.f : (py - _tailoredBottomY); } } if(!_enableWrap){ - auto px = _lettersInfo[ctr].positionX + letterDef.width/2 + _linesOffsetX[_lettersInfo[ctr].lineIndex]; + auto px = _lettersInfo[ctr].positionX + letterDef.width/2 * _bmfontScale + _linesOffsetX[_lettersInfo[ctr].lineIndex]; if(_labelWidth > 0.f){ if (px > _contentSize.width || px < 0) { if(_overflow == Overflow::CLAMP){ diff --git a/cocos/2d/CCLabelTextFormatter.cpp b/cocos/2d/CCLabelTextFormatter.cpp index 9454b39e46..00cbbbe7f0 100644 --- a/cocos/2d/CCLabelTextFormatter.cpp +++ b/cocos/2d/CCLabelTextFormatter.cpp @@ -267,7 +267,7 @@ bool Label::isHorizontalClamp() { auto& letterDef = _fontAtlas->_letterDefinitions[_lettersInfo[ctr].utf16Char]; - auto px = _lettersInfo[ctr].positionX + letterDef.width/2; + auto px = _lettersInfo[ctr].positionX + letterDef.width/2 * _bmfontScale; if(_labelWidth > 0.f){ if (px > _contentSize.width) { letterClamp = true;