mirror of https://github.com/axmolengine/axmol.git
Merge pull request #14543 from zilongshanren/fixLabelOverflowShrink
fix label clamp when scaled with bmfont
This commit is contained in:
commit
706e005c3d
|
@ -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){
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue