Skip to content

Commit 29fcfc5

Browse files
committed
Fixed TilemapParser - would spit out a tileset warning if margin/spacing were set (fix phaserjs#485, thanks Cybolic)
1 parent 994eaff commit 29fcfc5

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
@@ -164,6 +164,7 @@ Bug Fixes:
164164
* Swapping between tabs will pause and resume tweens correctly, allowing their onComplete events to still fire (fixes #292)
165165
* Fullscreen mode now uses window.outerWidth/Height when using EXACT_FIT as the scale mode, which fixes input coordinate errors (fixes #232)
166166
* Fullscreen mode now works in Internet Explorer and uses the new fullscreen non-prefix call.
167+
* Fixed TilemapParser - would spit out a tileset warning if margin/spacing were set (fix #485, thanks Cybolic)
167168

168169

169170
TO DO:

src/tilemap/TilemapParser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ Phaser.TilemapParser = {
396396
newSet.tileProperties = set.tileproperties;
397397
}
398398

399-
newSet.rows = (set.imageheight - set.margin) / (set.tileheight + set.spacing);
400-
newSet.columns = (set.imagewidth - set.margin) / (set.tilewidth + set.spacing);
399+
newSet.rows = Math.round((set.imageheight - set.margin) / (set.tileheight + set.spacing));
400+
newSet.columns = Math.round((set.imagewidth - set.margin) / (set.tilewidth + set.spacing));
401401
newSet.total = newSet.rows * newSet.columns;
402402

403403
if (newSet.rows % 1 !== 0 || newSet.columns % 1 !== 0)

0 commit comments

Comments
 (0)