Permalink
Browse files

Use retina res in example .js

  • Loading branch information...
1 parent f03d9a4 commit ee5271bfd1e34a3de593508c436dd8e7530721a5 @phoboslab committed Dec 18, 2015
Showing with 6 additions and 2 deletions.
  1. +6 −2 index.js
View
@@ -6,14 +6,18 @@
*/
var w = window.innerWidth;
var h = window.innerHeight;
+var scale = window.devicePixelRatio;
var w2 = w/2;
var h2 = h/2;
var canvas = document.getElementById('canvas');
-canvas.width = w;
-canvas.height = h;
+canvas.width = w * scale;
+canvas.height = h * scale;
+canvas.style.width = w;
+canvas.style.height = h;
var ctx = canvas.getContext('2d');
+ctx.scale(scale, scale);
var curves = [];

0 comments on commit ee5271b

Please sign in to comment.