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:
James Chen 2014-01-21 01:51:57 -08:00
commit b647659c9e
1 changed files with 2 additions and 2 deletions

View File

@ -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());