From bd515f7e50747356765dddb070364e5494b9fd64 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Wed, 1 Jan 2020 20:21:47 -0800 Subject: [PATCH] Real 1px lines --- src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.js b/src/index.js index a9b4cae5..00d1a85a 100644 --- a/src/index.js +++ b/src/index.js @@ -271,6 +271,10 @@ const canvas = document.getElementById("canvas"); const rc = rough.canvas(canvas); const context = canvas.getContext("2d"); +// Big hack to ensure that all the 1px lines are drawn at 1px instead of 2px +// https://stackoverflow.com/questions/13879322/drawing-a-1px-thick-line-in-canvas-creates-a-2px-thick-line/13879402#comment90766599_13879402 +context.translate(0.5, 0.5); + function drawScene() { ReactDOM.render(, rootElement);