From d44f3196c925332dcaf45f7cf8c64e22a1994bb9 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 4 Jun 2012 17:11:06 -0700 Subject: Fill and Ink-Bottle fixes. Signed-off-by: Nivesh Rajbhandari --- js/tools/InkBottleTool.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'js/tools/InkBottleTool.js') diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js index 2c03d133..bb5d3ae2 100755 --- a/js/tools/InkBottleTool.js +++ b/js/tools/InkBottleTool.js @@ -87,18 +87,18 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, { if(this.options.useBorderWidth.checked || this.options.useBorderStyle.checked) { colorInfo.borderInfo = {}; if(this.options.useBorderWidth.checked) { - colorInfo.borderInfo.borderWidth = this.options._borderWidth.value; - colorInfo.borderInfo.borderUnits = this.options._borderWidth.units; + colorInfo.borderInfo.borderWidth = this.options.borderWidth.value; + colorInfo.borderInfo.borderUnits = this.options.borderWidth.units; } if(this.options.useBorderStyle.checked) { - colorInfo.borderInfo.borderStyle = this.options._borderStyle.value; + colorInfo.borderInfo.borderStyle = this.options.borderStyle.value; } } if(this.options.useStrokeSize.checked) { colorInfo.strokeInfo = {}; - colorInfo.strokeInfo.strokeSize = this.options._strokeSize.value; - colorInfo.strokeInfo.strokeUnits = this.options._strokeSize.units; + colorInfo.strokeInfo.strokeSize = this.options.strokeSize.value; + colorInfo.strokeInfo.strokeUnits = this.options.strokeSize.units; } ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, false, "Change", "inkBottleTool"); -- cgit v1.2.3 From 945fac7b1593260757b6f2864810ca9916d7d698 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 5 Jun 2012 11:36:03 -0700 Subject: Updated ink bottle tool to support color-chip's checkbox and undo/redo for strokes/borders. Signed-off-by: Nivesh Rajbhandari --- js/tools/InkBottleTool.js | 49 +++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 21 deletions(-) (limited to 'js/tools/InkBottleTool.js') diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js index bb5d3ae2..dff0b0fa 100755 --- a/js/tools/InkBottleTool.js +++ b/js/tools/InkBottleTool.js @@ -69,39 +69,46 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, { if(this._canColor && this.application.ninja.selectedElements.length) { - var color = this.options.stroke, - colorInfo; - if(color && color.color) - { - colorInfo = { mode:color.colorMode, - color:color.color - }; - } - else - { - colorInfo = { mode:"nocolor", - color:color.color - }; + var strokeInfo = {}, + color; + if(this.options.useStrokeColor.checked) { + strokeInfo.colorInfo = {}; + color = this.options.stroke; + if(color && color.color) + { + strokeInfo.colorInfo.mode = color.colorMode; + strokeInfo.colorInfo.color = color.color; + } else { + strokeInfo.colorInfo.mode = "nocolor"; + strokeInfo.colorInfo.color = null; + } } if(this.options.useBorderWidth.checked || this.options.useBorderStyle.checked) { - colorInfo.borderInfo = {}; + strokeInfo.borderInfo = {}; if(this.options.useBorderWidth.checked) { - colorInfo.borderInfo.borderWidth = this.options.borderWidth.value; - colorInfo.borderInfo.borderUnits = this.options.borderWidth.units; + strokeInfo.borderInfo.borderWidth = this.options.borderWidth.value; + strokeInfo.borderInfo.borderUnits = this.options.borderWidth.units; } if(this.options.useBorderStyle.checked) { - colorInfo.borderInfo.borderStyle = this.options.borderStyle.value; + strokeInfo.borderInfo.borderStyle = this.options.borderStyle.value; } } if(this.options.useStrokeSize.checked) { - colorInfo.strokeInfo = {}; - colorInfo.strokeInfo.strokeSize = this.options.strokeSize.value; - colorInfo.strokeInfo.strokeUnits = this.options.strokeSize.units; + strokeInfo.shapeInfo = {}; + strokeInfo.shapeInfo.strokeSize = this.options.strokeSize.value; + strokeInfo.shapeInfo.strokeUnits = this.options.strokeSize.units; + } + + if(this.options.useWebGL.checked) { + strokeInfo.webGLInfo = {}; + strokeInfo.webGLInfo.material = this.options.strokeMaterial.value; } - ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, false, "Change", "inkBottleTool"); + if(strokeInfo.colorInfo || strokeInfo.borderInfo || strokeInfo.shapeInfo || strokeInfo.webGLInfo) { + ElementsMediator.setStroke(this.application.ninja.selectedElements, strokeInfo, "Change", "inkBottleTool"); + } } } } -- cgit v1.2.3 From e4e3ee77aa01f9b6e7592306ebfa9f123a60c624 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 6 Jun 2012 13:59:37 -0700 Subject: Do not create any tags or shapes with width or height of 0. Signed-off-by: Nivesh Rajbhandari --- js/tools/InkBottleTool.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js/tools/InkBottleTool.js') diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js index dff0b0fa..c5640b10 100755 --- a/js/tools/InkBottleTool.js +++ b/js/tools/InkBottleTool.js @@ -65,6 +65,7 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, { // Called by modifier tool base's HandleLeftButtonDown after updating selection (if needed) startDraw: { value: function(event) { + this.drawData = null; this.isDrawing = true; if(this._canColor && this.application.ninja.selectedElements.length) -- cgit v1.2.3