From 74de894ed9bd1e8c33930f426d69e2d30f54cef3 Mon Sep 17 00:00:00 2001 From: Martti Laine Date: Sat, 12 Nov 2016 13:31:50 +0200 Subject: [PATCH] Fixes #220 --- src/render/Render.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/render/Render.js b/src/render/Render.js index fb8b56a..6ce4660 100644 --- a/src/render/Render.js +++ b/src/render/Render.js @@ -385,9 +385,11 @@ var Vector = require('../geometry/Vector'); c.lineTo(constraint.pointB.x, constraint.pointB.y); } - c.lineWidth = constraint.render.lineWidth; - c.strokeStyle = constraint.render.strokeStyle; - c.stroke(); + if (constraint.render.lineWidth) { + c.lineWidth = constraint.render.lineWidth; + c.strokeStyle = constraint.render.strokeStyle; + c.stroke(); + } } }; @@ -523,15 +525,19 @@ var Vector = require('../geometry/Vector'); if (!options.wireframes) { c.fillStyle = part.render.fillStyle; - c.lineWidth = part.render.lineWidth; - c.strokeStyle = part.render.strokeStyle; + + if (part.render.lineWidth) { + c.lineWidth = part.render.lineWidth; + c.strokeStyle = part.render.strokeStyle; + c.stroke(); + } + c.fill(); } else { c.lineWidth = 1; c.strokeStyle = '#bbb'; + c.stroke(); } - - c.stroke(); } c.globalAlpha = 1;