The position of the node will be wrong

What’s the issue?

  • When the position of the parent changed, and the node add to another node, the position will be wrong.
    I found that the reason is the node transform not update after the node add again to another parent.
    I fix the issue by adding following line in “void Node::setParent(Node * var)”
_transformUpdated = _transformDirty = _inverseDirty = true;

What’s the engine version?

  • cocos2dx 3.0 rc0

How to reproduce it?

  • Add nodeA to nodeB as child. Change the position of nodeB. Remove nodeA from nodeB. Add nodeA to nodeC, the position of nodeC is difference from nodeB. Will see the position of nodeA is wrong.