mirror of https://github.com/axmolengine/axmol.git
[CCLabel] Apply updateContent() for getStringNumLines() when Label is dirty
This commit is contained in:
parent
14f92759a4
commit
d1faf75b58
|
@ -1226,6 +1226,15 @@ void Label::computeStringNumLines()
|
|||
_currNumLines = quantityOfLines;
|
||||
}
|
||||
|
||||
int Label::getStringNumLines() const {
|
||||
if (_contentDirty)
|
||||
{
|
||||
const_cast<Label*>(this)->updateContent();
|
||||
}
|
||||
|
||||
return _currNumLines;
|
||||
}
|
||||
|
||||
int Label::getStringLength() const
|
||||
{
|
||||
return static_cast<int>(_currentUTF16String.length());
|
||||
|
|
|
@ -235,7 +235,7 @@ public:
|
|||
float getAdditionalKerning() const;
|
||||
|
||||
// string related stuff
|
||||
int getStringNumLines() const { return _currNumLines;}
|
||||
int getStringNumLines() const;
|
||||
int getStringLength() const;
|
||||
|
||||
FontAtlas* getFontAtlas() { return _fontAtlas; }
|
||||
|
|
Loading…
Reference in New Issue