From f71f1413878d28d704b8facbd4a165e21bc8c7ca Mon Sep 17 00:00:00 2001 From: "Luis A. Leiva" Date: Tue, 2 Feb 2016 09:43:57 +0100 Subject: [PATCH] Fixed pencil/eraser switch modes --- jsketch.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jsketch.js b/jsketch.js index 02e0d59..d858c37 100644 --- a/jsketch.js +++ b/jsketch.js @@ -347,7 +347,7 @@ eraser: function(brushSize) { if (typeof brushSize === 'undefined') brushSize = 15; this.graphics.globalCompositeOperation = "destination-out"; - this.graphics.lineWidth = brushSize; + this.lineStyle(null, brushSize); return this; }, /** @@ -357,8 +357,9 @@ * @memberof jSketch */ pencil: function(brushSize) { - if (typeof brushSize !== 'undefined') this.graphics.lineWidth = brushSize; + if (typeof brushSize === 'undefined') brushSize = 2; this.graphics.globalCompositeOperation = "source-over"; + this.lineStyle(null, brushSize); return this; }, /**