diff options
Diffstat (limited to 'js/tools/ShapeTool.js')
-rwxr-xr-x | js/tools/ShapeTool.js | 26 |
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 | ||