mirror of https://github.com/axmolengine/axmol.git
Add items as protected children.
This commit is contained in:
parent
57943b41b1
commit
b92733c402
|
@ -178,7 +178,7 @@ void RichText::formatText()
|
|||
{
|
||||
if (_formatTextDirty)
|
||||
{
|
||||
this->removeAllChildren();
|
||||
this->removeAllProtectedChildren();
|
||||
_elementRenders.clear();
|
||||
if (_ignoreSize)
|
||||
{
|
||||
|
@ -353,7 +353,7 @@ void RichText::formarRenderers()
|
|||
Node* l = row->at(j);
|
||||
l->setAnchorPoint(Vec2::ZERO);
|
||||
l->setPosition(nextPosX, 0.0f);
|
||||
this->addChild(l, 1);
|
||||
this->addProtectedChild(l, 1);
|
||||
Size iSize = l->getContentSize();
|
||||
newContentSizeWidth += iSize.width;
|
||||
newContentSizeHeight = MAX(newContentSizeHeight, iSize.height);
|
||||
|
@ -391,7 +391,7 @@ void RichText::formarRenderers()
|
|||
Node* l = row->at(j);
|
||||
l->setAnchorPoint(Vec2::ZERO);
|
||||
l->setPosition(nextPosX, nextPosY);
|
||||
this->addChild(l, 1);
|
||||
this->addProtectedChild(l, 1);
|
||||
nextPosX += l->getContentSize().width;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,6 +93,9 @@ bool UIRichTextTest::init()
|
|||
|
||||
_widget->addChild(_richText);
|
||||
|
||||
// test remove all children, this call won't effect the test
|
||||
_richText->removeAllChildren();
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue