From 8e8d09e8258111258abdf986fbf13d1dfcdfab7e Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Sat, 11 Feb 2017 18:36:12 -0500 Subject: [PATCH] Make bezier canvases HiDPI-aware. (#47) * Make bezier canvases HiDPI-aware. * Fix HiDPI bugs and linting issues. * Address review comments. --- components/Graphic.jsx | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/components/Graphic.jsx b/components/Graphic.jsx index 06af4b53..5349e0fa 100644 --- a/components/Graphic.jsx +++ b/components/Graphic.jsx @@ -16,6 +16,7 @@ var Graphic = React.createClass({ defaultWidth: 275, defaultHeight: 275, + panelCount: 1, Bezier: Bezier, utils: Bezier.getUtils(), @@ -53,6 +54,10 @@ var Graphic = React.createClass({
{ image.loaded = true; - this.ctx.drawImage(image,offset.x,offset.y); + this.ctx.drawImage(image,offset.x,offset.y, image.width/dpr, image.height/dpr); }; } },