aboutsummaryrefslogtreecommitdiff
path: root/js/tools/InkBottleTool.js
diff options
context:
space:
mode:
authorJonathan Duran2012-06-06 11:22:43 -0700
committerJonathan Duran2012-06-06 11:22:43 -0700
commit020a8147088f09547b7e84db2ada7c48f25c089f (patch)
tree5ec53061c4437d7a7cd8c983ef8a17aa6cfe0e19 /js/tools/InkBottleTool.js
parentb73cc6e348f3eb4cd57b5afeb7a6f5d3633b7e6b (diff)
parent18e212dca48066d1ddaca96875a3f40adcc859b6 (diff)
downloadninja-020a8147088f09547b7e84db2ada7c48f25c089f.tar.gz
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
Diffstat (limited to 'js/tools/InkBottleTool.js')
-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 2c03d133..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 }