aboutsummaryrefslogtreecommitdiff
path: root/js/tools/PenTool.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/PenTool.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/PenTool.js')
-rwxr-xr-xjs/tools/PenTool.js32
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