From a0daa3668883c8c35ce277b60509a3a3dcf303b2 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 24 Apr 2012 11:42:42 -0700 Subject: Allow users to toggle application of stroke and border settings when using the ink bottle tool. Signed-off-by: Nivesh Rajbhandari --- js/tools/InkBottleTool.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'js/tools') diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js index 95c2e71d..960c19fa 100755 --- a/js/tools/InkBottleTool.js +++ b/js/tools/InkBottleTool.js @@ -84,14 +84,22 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, { }; } - colorInfo.borderInfo = { borderStyle:this.options._borderStyle.value, - borderWidth:this.options._borderWidth.value, - borderUnits:this.options._borderWidth.units - }; + 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; + } + if(this.options.useBorderStyle.checked) { + colorInfo.borderInfo.borderStyle = this.options._borderStyle.value; + } + } - colorInfo.strokeInfo = { strokeSize:this.options._strokeSize.value, - strokeUnits:this.options._strokeSize.units - }; + if(this.options.useStrokeSize.checked) { + colorInfo.strokeInfo = {}; + 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