Skip to content
Browse files

fix me being stupid bug

  • Loading branch information...
1 parent d13ebeb commit 21ac87c2862d3a044168f8f3f8a006da7a103163 @tj tj committed
Showing with 4 additions and 3 deletions.
  1. +4 −3 index.js
View
7 index.js
@@ -8,11 +8,12 @@
*/
module.exports = function(canvas){
+ var ratio = window.devicePixelRatio || 1;
canvas.style.width = canvas.width;
canvas.style.height = canvas.height;
- canvas.width *= devicePixelRatio;
- canvas.height *= devicePixelRatio;
+ canvas.width *= ratio;
+ canvas.height *= ratio;
var ctx = canvas.getContext('2d');
- ctx.scale(2, 2);
+ ctx.scale(ratio, ratio);
return canvas;
};

0 comments on commit 21ac87c

Please sign in to comment.
Something went wrong with that request. Please try again.