aboutsummaryrefslogtreecommitdiff
path: root/js/tools/PenTool.js
diff options
context:
space:
mode:
authorArmen Kesablyan2012-07-02 13:19:20 -0700
committerArmen Kesablyan2012-07-02 13:19:20 -0700
commit526b9d76686323f488f1b26175440172b715d808 (patch)
tree47fc6bd90715b403a08d08a48a86f4d24da1ba29 /js/tools/PenTool.js
parentb194664df7e01aaeb8d1e7220a6de0e7f879f1db (diff)
parent12de4e49a309e210c13eb40b2ffa158ef2eb54a7 (diff)
downloadninja-526b9d76686323f488f1b26175440172b715d808.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
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