Skip to content

Commit aec5557

Browse files
committed
Testing difference between w/h and scale
1 parent 6d80772 commit aec5557

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

src/dom/ScaleManager.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ var ScaleManager = new Class({
174174
this.scaleMode = scaleMode;
175175

176176
// The un-modified game size, as requested in the game config.
177-
this.gameSize.setSize(width, height);
177+
this.gameSize.setSize(width * resolution, height * resolution);
178+
179+
// this.gameSize.setSize((width * zoom) * resolution, (height * zoom) * resolution);
178180

179181
// if (scaleMode < 5)
180182
// {
@@ -191,11 +193,13 @@ var ScaleManager = new Class({
191193
this.canvasSize.setMax(config.maxWidth * zoom, config.maxHeight * zoom);
192194
}
193195

194-
console.log('set canvas size', width, height);
196+
// console.log('set canvas size', width, height);
197+
198+
this.canvasSize.setSize(width * zoom, height * zoom);
195199

196-
this.canvasSize.setSize((width * zoom) * resolution, (height * zoom) * resolution);
200+
// this.canvasSize.setSize((width * zoom) * resolution, (height * zoom) * resolution);
197201

198-
console.log(this.canvasSize.toString());
202+
// console.log(this.canvasSize.toString());
199203
},
200204

201205
// Fires AFTER the canvas has been added to the DOM
@@ -251,9 +255,18 @@ var ScaleManager = new Class({
251255

252256
this.canvasSize.setSize(this.parentSize.width, this.parentSize.height);
253257

258+
// var sx = (this.canvasSize.width / this.gameSize.width) / this.resolution;
259+
// var sy = (this.canvasSize.height / this.gameSize.height) / this.resolution;
260+
261+
// style.transformOrigin = '0 0';
262+
// style.transform = 'scale(' + sx + ',' + sy + ')';
263+
254264
style.width = this.canvasSize.width + 'px';
255265
style.height = this.canvasSize.height + 'px';
256266

267+
// style.width = this.canvasSize.width / this.resolution + 'px';
268+
// style.height = this.canvasSize.height / this.resolution + 'px';
269+
257270
console.log(this.canvasSize.toString());
258271
}
259272
},

0 commit comments

Comments
 (0)