Merge pull request #786 from kzhdev/fix-setPixelRatio

fixed an issue where setPixelRatio changed canvas to wrong size
This commit is contained in:
Eric Rowell 2014-02-26 08:03:00 -08:00
commit 04b19e7d8a

View File

@ -86,8 +86,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.
*/
setPixelRatio: function(pixelRatio) {
var width = this.getWidth() / this.pixelRatio,
height = this.getHeight() / this.pixelRatio;
this.pixelRatio = pixelRatio;
this.setSize(this.getWidth(), this.getHeight());
this.setSize(width, height);
},
/**
* set width