mirror of https://github.com/axmolengine/axmol.git
Label:Fixed the character positions could be wrong if `getLetter(letterIndex)` get called.
This commit is contained in:
parent
004cb5464e
commit
22c46b5c14
|
@ -628,13 +628,15 @@ void Label::alignText()
|
||||||
letterSprite = dynamic_cast<Sprite*>(child);
|
letterSprite = dynamic_cast<Sprite*>(child);
|
||||||
if (letterSprite)
|
if (letterSprite)
|
||||||
{
|
{
|
||||||
uvRect.size.height = _lettersInfo[tag].def.height;
|
auto& letterDef = _lettersInfo[tag].def;
|
||||||
uvRect.size.width = _lettersInfo[tag].def.width;
|
uvRect.size.height = letterDef.height;
|
||||||
uvRect.origin.x = _lettersInfo[tag].def.U;
|
uvRect.size.width = letterDef.width;
|
||||||
uvRect.origin.y = _lettersInfo[tag].def.V;
|
uvRect.origin.x = letterDef.U;
|
||||||
|
uvRect.origin.y = letterDef.V;
|
||||||
|
|
||||||
letterSprite->setTexture(textures.at(_lettersInfo[tag].def.textureID));
|
letterSprite->setTexture(textures.at(letterDef.textureID));
|
||||||
letterSprite->setTextureRect(uvRect);
|
letterSprite->setTextureRect(uvRect);
|
||||||
|
letterSprite->setPosition(_lettersInfo[tag].position);
|
||||||
}
|
}
|
||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue