From ed03702cd5f98ad90e908ff31e9dbd98824f6ac9 Mon Sep 17 00:00:00 2001 From: kzhdev Date: Thu, 30 Jan 2014 16:15:18 -0600 Subject: [PATCH] fixed an issue where setPixelRatio changed canvas to wrong size --- src/Canvas.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Canvas.js b/src/Canvas.js index 6559a29f..8813b3e6 100644 --- a/src/Canvas.js +++ b/src/Canvas.js @@ -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. */ 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