diff options
Diffstat (limited to 'js/tools/PenTool.js')
-rwxr-xr-x | js/tools/PenTool.js | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index 2cffb44d..1097f28c 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js | |||
@@ -338,22 +338,28 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
338 | } | 338 | } |
339 | this._selectedSubpath.setStrokeWidth(strokeSize); | 339 | this._selectedSubpath.setStrokeWidth(strokeSize); |
340 | 340 | ||
341 | var colorArray=[]; | 341 | var colorObj; |
342 | var color = this.options.stroke.color; | 342 | var stroke = this.options.stroke; |
343 | if (color){ | 343 | var color = stroke.color; |
344 | colorArray = [color.r/255, color.g/255, color.b/255, color.a]; | 344 | if(stroke.colorMode === "gradient") { |
345 | }else { | 345 | colorObj = {gradientMode:stroke.color.gradientMode, color:stroke.color.stops}; |
346 | colorArray = [1,1,1,0]; | 346 | } else if (color) { |
347 | colorObj = [color.r/255, color.g/255, color.b/255, color.a]; | ||
348 | } else { | ||
349 | colorObj = [1,1,1,0]; | ||
347 | } | 350 | } |
348 | this._selectedSubpath.setStrokeColor(colorArray); | 351 | this._selectedSubpath.setStrokeColor(colorObj); |
349 | 352 | ||
350 | color = this.options.fill.color; | 353 | var fill = this.options.fill; |
351 | if (color){ | 354 | color = fill.color; |
352 | colorArray = [color.r/255, color.g/255, color.b/255, color.a]; | 355 | if(fill.colorMode === "gradient") { |
356 | colorObj = {gradientMode:fill.color.gradientMode, color:fill.color.stops}; | ||
357 | } else if (color) { | ||
358 | colorObj = [color.r/255, color.g/255, color.b/255, color.a]; | ||
353 | } else { | 359 | } else { |
354 | colorArray = [1,1,1,0]; | 360 | colorObj = [1,1,1,0]; |
355 | } | 361 | } |
356 | this._selectedSubpath.setFillColor(colorArray); | 362 | this._selectedSubpath.setFillColor(colorObj); |
357 | } //if the selectedSubpath was null and needed to be constructed | 363 | } //if the selectedSubpath was null and needed to be constructed |
358 | 364 | ||
359 | //build the current mouse position in stage world space in case we don't already have a canvas | 365 | //build the current mouse position in stage world space in case we don't already have a canvas |