aboutsummaryrefslogtreecommitdiff
path: root/js/tools/ShapeTool.js
diff options
context:
space:
mode:
authorhwc4872012-06-29 13:01:02 -0700
committerhwc4872012-06-29 13:01:02 -0700
commit44eba9c1f7935ae13e87a6dcf6ddea0efa63eb05 (patch)
tree77ec7650cbc397c1792254529b0430cd691fad08 /js/tools/ShapeTool.js
parent230b3d0fdfd29e998b82fef9f1ff5d2ca7ef8596 (diff)
parentecd9e3b3b09695e3e7115c04e75add5a20c5c6fe (diff)
downloadninja-44eba9c1f7935ae13e87a6dcf6ddea0efa63eb05.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Taper
Diffstat (limited to 'js/tools/ShapeTool.js')
-rwxr-xr-xjs/tools/ShapeTool.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js
index 8d381711..6ff61546 100755
--- a/js/tools/ShapeTool.js
+++ b/js/tools/ShapeTool.js
@@ -209,7 +209,31 @@ exports.ShapeTool = Montage.create(DrawingTool, {
209 209
210 return target; 210 return target;
211 } 211 }
212 } 212 },
213
214 // We can draw on an existing canvas unless it has only a single shape object
215 setColor: {
216 value: function(stroke, fill, canvas, toolId)
217 {
218 if(stroke && stroke.color)
219 {
220 this.application.ninja.elementMediator.setColor([canvas], {mode:stroke.colorMode, color:stroke.color}, false, "Change", toolId);
221 }
222 else
223 {
224 this.application.ninja.elementMediator.setColor([canvas], {mode:"nocolor", color:null}, false, "Change", toolId);
225 }
226
227 if(fill && fill.color)
228 {
229 this.application.ninja.elementMediator.setColor([canvas], {mode:fill.colorMode, color:fill.color}, true, "Change", toolId);
230 }
231 else
232 {
233 this.application.ninja.elementMediator.setColor([canvas], {mode:"nocolor", color:null}, true, "Change", toolId);
234 }
235 }
236 }
213 237
214}); 238});
215 239