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/InkBottleTool.js') 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 From 238586be0df568c6804268d97bf9d3ef7cd33fda Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 26 Apr 2012 15:33:48 -0700 Subject: Simplifying the getElement method from stage and adding an exclusion list to the new template Signed-off-by: Valerio Virgillito --- js/tools/InkBottleTool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tools/InkBottleTool.js') diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js index 960c19fa..fd17f4d6 100755 --- a/js/tools/InkBottleTool.js +++ b/js/tools/InkBottleTool.js @@ -16,7 +16,7 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, { HandleMouseMove: { value : function (event) { - var obj = this.application.ninja.stage.GetSelectableElement(event); + var obj = this.application.ninja.stage.getElement(event, true); var cursor = "url('images/cursors/ink.png') 6 11, default"; var canColor = true; if (obj) -- cgit v1.2.3