diff options
author | Jose Antonio Marquez Russo | 2012-06-26 10:58:53 -0700 |
---|---|---|
committer | Jose Antonio Marquez Russo | 2012-06-26 10:58:53 -0700 |
commit | 6ce459a96df2a111dbae84cddab625dfb27b64a5 (patch) | |
tree | eccf5cea414ab9c4a0370b5316e34eae5ee14a9e /js/tools/ShapeTool.js | |
parent | 60356eeb3f38acadb87d4a3a9301a194941221d9 (diff) | |
parent | 2f0a29c2cc9fd399e392abfd6770caffb99fdbb5 (diff) | |
download | ninja-6ce459a96df2a111dbae84cddab625dfb27b64a5.tar.gz |
Merge pull request #38 from mqg734/Jose_Color
Added pre-flight support for gradients in Tag, Rect, Oval, Line, Brush and Pen tools.
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 | ||