Skip to content

Commit 6d967b6

Browse files
committed
Error in diffX and diffY calculation in Tilemap.paste (thanks @amelia410 phaserjs#1446)
1 parent a67d2df commit 6d967b6

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Version 2.3.0 - "Tarabon" - in dev
7474

7575
* SoundManager.unlock checks for audio `start` support and falls back to `noteOn` if not found.
7676
* Sprite.frame and AnimationManager.frame wouldn't return the correct index if a sprite sheet was being used unless it had first been set via the setter.
77+
* Error in diffX and diffY calculation in Tilemap.paste (thanks @amelia410 #1446)
7778

7879
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
7980

src/tilemap/Tilemap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,8 +1550,8 @@ Phaser.Tilemap.prototype = {
15501550
}
15511551

15521552
// Find out the difference between tileblock[1].x/y and x/y and use it as an offset, as it's the top left of the block to paste
1553-
var diffX = tileblock[1].x - x;
1554-
var diffY = tileblock[1].y - y;
1553+
var diffX = x - tileblock[1].x;
1554+
var diffY = y - tileblock[1].y;
15551555

15561556
for (var i = 1; i < tileblock.length; i++)
15571557
{

0 commit comments

Comments
 (0)