aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-06-05 11:36:03 -0700
committerNivesh Rajbhandari2012-06-05 11:36:03 -0700
commit945fac7b1593260757b6f2864810ca9916d7d698 (patch)
tree2cd28fbc40578c5cef4337f5680a20d1ebf87fe8 /js/tools
parentd44f3196c925332dcaf45f7cf8c64e22a1994bb9 (diff)
downloadninja-945fac7b1593260757b6f2864810ca9916d7d698.tar.gz
Updated ink bottle tool to support color-chip's checkbox and undo/redo for strokes/borders.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/tools')
-rwxr-xr-xjs/tools/InkBottleTool.js49
1 files changed, 28 insertions, 21 deletions
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, {
69 69
70 if(this._canColor && this.application.ninja.selectedElements.length) 70 if(this._canColor && this.application.ninja.selectedElements.length)
71 { 71 {
72 var color = this.options.stroke, 72 var strokeInfo = {},
73 colorInfo; 73 color;
74 if(color && color.color) 74 if(this.options.useStrokeColor.checked) {
75 { 75 strokeInfo.colorInfo = {};
76 colorInfo = { mode:color.colorMode, 76 color = this.options.stroke;
77 color:color.color 77 if(color && color.color)
78 }; 78 {
79 } 79 strokeInfo.colorInfo.mode = color.colorMode;
80 else 80 strokeInfo.colorInfo.color = color.color;
81 { 81 } else {
82 colorInfo = { mode:"nocolor", 82 strokeInfo.colorInfo.mode = "nocolor";
83 color:color.color 83 strokeInfo.colorInfo.color = null;
84 }; 84 }
85 } 85 }
86 86
87 if(this.options.useBorderWidth.checked || this.options.useBorderStyle.checked) { 87 if(this.options.useBorderWidth.checked || this.options.useBorderStyle.checked) {
88 colorInfo.borderInfo = {}; 88 strokeInfo.borderInfo = {};
89 if(this.options.useBorderWidth.checked) { 89 if(this.options.useBorderWidth.checked) {
90 colorInfo.borderInfo.borderWidth = this.options.borderWidth.value; 90 strokeInfo.borderInfo.borderWidth = this.options.borderWidth.value;
91 colorInfo.borderInfo.borderUnits = this.options.borderWidth.units; 91 strokeInfo.borderInfo.borderUnits = this.options.borderWidth.units;
92 } 92 }
93 if(this.options.useBorderStyle.checked) { 93 if(this.options.useBorderStyle.checked) {
94 colorInfo.borderInfo.borderStyle = this.options.borderStyle.value; 94 strokeInfo.borderInfo.borderStyle = this.options.borderStyle.value;
95 } 95 }
96 } 96 }
97 97
98 if(this.options.useStrokeSize.checked) { 98 if(this.options.useStrokeSize.checked) {
99 colorInfo.strokeInfo = {}; 99 strokeInfo.shapeInfo = {};
100 colorInfo.strokeInfo.strokeSize = this.options.strokeSize.value; 100 strokeInfo.shapeInfo.strokeSize = this.options.strokeSize.value;
101 colorInfo.strokeInfo.strokeUnits = this.options.strokeSize.units; 101 strokeInfo.shapeInfo.strokeUnits = this.options.strokeSize.units;
102 }
103
104 if(this.options.useWebGL.checked) {
105 strokeInfo.webGLInfo = {};
106 strokeInfo.webGLInfo.material = this.options.strokeMaterial.value;
102 } 107 }
103 108
104 ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, false, "Change", "inkBottleTool"); 109 if(strokeInfo.colorInfo || strokeInfo.borderInfo || strokeInfo.shapeInfo || strokeInfo.webGLInfo) {
110 ElementsMediator.setStroke(this.application.ninja.selectedElements, strokeInfo, "Change", "inkBottleTool");
111 }
105 } 112 }
106 } 113 }
107 } 114 }