mirror of https://github.com/axmolengine/axmol.git
fix crash when sort children while label type is STRING_TEXTURE. since the only one child sprite is not add with batch mode
This commit is contained in:
parent
1328d1a898
commit
503fed5313
|
@ -786,6 +786,15 @@ void Label::addChild(Node * child, int zOrder/* =0 */, int tag/* =0 */)
|
||||||
CCASSERT(0, "addChild: is not supported on Label.");
|
CCASSERT(0, "addChild: is not supported on Label.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Label::sortAllChildren()
|
||||||
|
{
|
||||||
|
// fix crash when sort children while label type is STRING_TEXTURE
|
||||||
|
// because of the only one child sprite is not add with batch mode
|
||||||
|
if (_currentLabelType != LabelType::STRING_TEXTURE) {
|
||||||
|
SpriteBatchNode::sortAllChildren();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Label::setLabelEffect(LabelEffect effect,const Color3B& effectColor)
|
void Label::setLabelEffect(LabelEffect effect,const Color3B& effectColor)
|
||||||
{
|
{
|
||||||
switch (effect)
|
switch (effect)
|
||||||
|
|
|
@ -239,6 +239,8 @@ public:
|
||||||
virtual float getScaleY() const override;
|
virtual float getScaleY() const override;
|
||||||
|
|
||||||
virtual void addChild(Node * child, int zOrder=0, int tag=0) override;
|
virtual void addChild(Node * child, int zOrder=0, int tag=0) override;
|
||||||
|
virtual void sortAllChildren() override;
|
||||||
|
|
||||||
virtual std::string getDescription() const override;
|
virtual std::string getDescription() const override;
|
||||||
|
|
||||||
virtual const Size& getContentSize() const override;
|
virtual const Size& getContentSize() const override;
|
||||||
|
|
Loading…
Reference in New Issue