Fixed pencil/eraser switch modes

This commit is contained in:
Luis A. Leiva 2016-02-02 09:43:57 +01:00
parent 552a404066
commit f71f141387
1 changed files with 3 additions and 2 deletions

View File

@ -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;
},
/**