From 64686feb8b46672ecca53fe61d909dd5c19d861b Mon Sep 17 00:00:00 2001 From: DD Date: Thu, 12 Apr 2018 14:27:07 -0400 Subject: [PATCH] review comments --- src/containers/paper-canvas.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/containers/paper-canvas.jsx b/src/containers/paper-canvas.jsx index 0d3cd52c..c3d36a91 100644 --- a/src/containers/paper-canvas.jsx +++ b/src/containers/paper-canvas.jsx @@ -95,22 +95,22 @@ class PaperCanvas extends React.Component { // Get rid of anti-aliasing // @todo get crisp text? - svg.setAttribute('shape-rendering', 'optimizeSpeed'); + svg.setAttribute('shape-rendering', 'crispEdges'); const svgString = (new XMLSerializer()).serializeToString(svg); // Put anti-aliased SVG into image, and dump image back into canvas const img = new Image(); - img.onload = function () { + img.onload = () => { const raster = new paper.Raster(img); - raster.onLoad = function () { + raster.onLoad = () => { const subCanvas = raster.canvas; getRaster().drawImage( subCanvas, new paper.Point(Math.floor(bounds.topLeft.x), Math.floor(bounds.topLeft.y))); paper.project.activeLayer.removeChildren(); this.props.onUpdateSvg(); - }.bind(this); - }.bind(this); + }; + }; img.src = `data:image/svg+xml;charset=utf-8,${svgString}`; } convertToVector () {