mirror of https://github.com/axmolengine/axmol.git
set z order after reorder
This commit is contained in:
parent
a2bfc31ea0
commit
a057274115
|
@ -237,11 +237,13 @@ void Node::_setZOrder(int z)
|
|||
|
||||
void Node::setZOrder(int z)
|
||||
{
|
||||
_setZOrder(z);
|
||||
if (_parent)
|
||||
{
|
||||
_parent->reorderChild(this, z);
|
||||
}
|
||||
// should set "_ZOrder" after reorderChild, because the implementation of reorderChild subclass of Node, such as Sprite,
|
||||
// will return when _ZOrder value is not changed
|
||||
_setZOrder(z);
|
||||
|
||||
_eventDispatcher->setDirtyForNode(this);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue