Skip to content

Commit a12157d

Browse files
authored
Merge pull request phaserjs#2691 from hexus/dev
Fixed widthInPixels/heightInPixels for JSON tilemaps and TilemapLayerGL display width/height
2 parents b59d832 + 50fc2cf commit a12157d

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

src/tilemap/TilemapLayerGL.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ Phaser.TilemapLayerGL.prototype.destroy = function() {
337337
Phaser.TilemapLayerGL.prototype.resize = function (width, height) {
338338

339339
// These setters will automatically update any linked children
340-
this.displayWidth = width;
341-
this.displayHeight = height;
340+
this.width = width;
341+
this.height = height;
342342

343343
this.dirty = true;
344344

@@ -512,16 +512,12 @@ Phaser.TilemapLayerGL.prototype.renderRegion = function (scrollX, scrollY, left,
512512
* @private
513513
*/
514514
Phaser.TilemapLayerGL.prototype.renderFull = function () {
515-
515+
516516
var scrollX = this._mc.scrollX;
517517
var scrollY = this._mc.scrollY;
518518

519-
// var renderW = this.game._width;
520-
// var renderH = this.game._height;
521-
522-
// displayWidth surely?
523-
var renderW = this.game._width;
524-
var renderH = this.game._height;
519+
var renderW = this._displayWidth;
520+
var renderH = this._displayHeight;
525521

526522
var tw = this._mc.tileWidth;
527523
var th = this._mc.tileHeight;

src/tilemap/TilemapParser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ Phaser.TilemapParser = {
201201
format: Phaser.Tilemap.TILED_JSON,
202202
version: json.version,
203203
properties: json.properties,
204-
widthInPixels: json.width * json.tileWidth,
205-
heightInPixels: json.height * json.tileHeight
204+
widthInPixels: json.width * json.tilewidth,
205+
heightInPixels: json.height * json.tileheight
206206
};
207207

208208
// Tile Layers

0 commit comments

Comments
 (0)