Skip to content

Commit

Permalink
[#737] Proper fix ImageLayer ratio *and* position
Browse files Browse the repository at this point in the history
- Seems the Wolfram Alpha optimization applied the ratio on the wrong side.
- This fixes the scrolling and positioning, according to further tests.
  • Loading branch information
parasyte committed Sep 6, 2015
1 parent 0c173cb commit f776da0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/level/TMXLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@
* direction when anchored to the bottom or right sides of the
* viewport boundary.
*/
x = ~~(-ax * rx * (bw - viewport.width) + ax * (bw - width) - vpos.x * rx),
y = ~~(-ay * ry * (bh - viewport.height) + ay * (bh - height) - vpos.y * ry);
x = ~~(-ax * (1 - rx) * (bw - viewport.width) + ax * (bw - width) - vpos.x * rx),
y = ~~(-ay * (1 - ry) * (bh - viewport.height) + ay * (bh - height) - vpos.y * ry);


// Repeat horizontally; start drawing from left boundary
Expand Down

0 comments on commit f776da0

Please sign in to comment.