aboutsummaryrefslogtreecommitdiff
path: root/js/tools/ShapeTool.js
diff options
context:
space:
mode:
authorAnanya Sen2012-06-28 15:19:28 -0700
committerAnanya Sen2012-06-28 15:19:28 -0700
commit624acffc0619d879deaa6dcd8ce3c0cfeaf2227a (patch)
treeca53a666a93f9bed8912a5c3211ba84fc603c58f /js/tools/ShapeTool.js
parente4d3e040e521648ec9a6d0e0db2e62754f2d8882 (diff)
parent3ba9accb8e1887bfd6f1f912b6135073a3d9c70c (diff)
downloadninja-624acffc0619d879deaa6dcd8ce3c0cfeaf2227a.tar.gz
Merge branch 'refs/heads/ninja-internal-master' into bugfix-master
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