Skip to content

Commit 21db165

Browse files
committed
don't need to calculate sprite position when push apart on zoom not used
1 parent 59cd758 commit 21db165

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sample/OpenflSample.hx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,13 @@ class OpenflSample extends Sprite
116116
containers[i].x = parallax.layers[i].x;
117117
containers[i].y = parallax.layers[i].y;
118118

119-
for (j in 0...containers[i].numChildren)
119+
if (parallax.pushApartOnZoom > 0)
120120
{
121-
containers[i].getChildAt(j).x = parallax.layers[i].sprites[j].x;
122-
containers[i].getChildAt(j).y = parallax.layers[i].sprites[j].y;
121+
for (j in 0...containers[i].numChildren)
122+
{
123+
containers[i].getChildAt(j).x = parallax.layers[i].sprites[j].x;
124+
containers[i].getChildAt(j).y = parallax.layers[i].sprites[j].y;
125+
}
123126
}
124127
}
125128

0 commit comments

Comments
 (0)