mirror of https://github.com/axmolengine/axmol.git
Merge pull request #5138 from natural-law/develop
closed #2572, Amend the arithmetic of child's position in ParallaxNode::addChild().
This commit is contained in:
commit
b647659c9e
|
@ -101,8 +101,8 @@ void ParallaxNode::addChild(Node *child, int z, const Point& ratio, const Point&
|
|||
ccArrayAppendObjectWithResize(_parallaxArray, (Object*)obj);
|
||||
|
||||
Point pos = _position;
|
||||
pos.x = pos.x * ratio.x + offset.x;
|
||||
pos.y = pos.y * ratio.y + offset.y;
|
||||
pos.x = -pos.x + pos.x * ratio.x + offset.x;
|
||||
pos.y = -pos.y + pos.y * ratio.y + offset.y;
|
||||
child->setPosition(pos);
|
||||
|
||||
Node::addChild(child, z, child->getTag());
|
||||
|
|
Loading…
Reference in New Issue