fixed an issue where setPixelRatio changed canvas to wrong size

This commit is contained in:
kzhdev
2014-01-30 16:15:18 -06:00
parent 774f50007c
commit ed03702cd5

View File

@@ -79,8 +79,10 @@
* ratio for special situations, or, if you don't want the pixel ratio to be taken into account, you can set it to 1. * ratio for special situations, or, if you don't want the pixel ratio to be taken into account, you can set it to 1.
*/ */
setPixelRatio: function(pixelRatio) { setPixelRatio: function(pixelRatio) {
var width = this.getWidth() / this.pixelRatio,
height = this.getHeight() / this.pixelRatio;
this.pixelRatio = pixelRatio; this.pixelRatio = pixelRatio;
this.setSize(this.getWidth(), this.getHeight()); this.setSize(width, height);
}, },
/** /**
* set width * set width