diff options
author | Nivesh Rajbhandari | 2012-04-17 10:19:20 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-04-17 10:19:20 -0700 |
commit | 2a87a750f06003fc62e8e0e73983e14ce24fc7a7 (patch) | |
tree | 9566a079910cd08542ac7b35e8bc417dcecf8d1e /js/controllers/elements | |
parent | c253192a08b499ea7be46fa5438d273e51f7ec5a (diff) | |
download | ninja-2a87a750f06003fc62e8e0e73983e14ce24fc7a7.tar.gz |
IKNinja-1477 - Cannot preflight Fill color if WebGL Line shape is selected.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/controllers/elements')
-rwxr-xr-x | js/controllers/elements/shapes-controller.js | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 14cdc473..a446ef05 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js | |||
@@ -399,8 +399,8 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
399 | if(isFill) | 399 | if(isFill) |
400 | { | 400 | { |
401 | // Properties Panel asks for fill color even for shapes that only have strokes | 401 | // Properties Panel asks for fill color even for shapes that only have strokes |
402 | // Check that shape object has a getFillColor method before getting fills | 402 | // Check that shape object supports fills |
403 | if(el.elementModel.shapeModel.GLGeomObj.getFillColor) | 403 | if(el.elementModel.shapeModel.GLGeomObj.canFill) |
404 | { | 404 | { |
405 | return this.application.ninja.colorController.colorModel.webGlToColor(el.elementModel.shapeModel.GLGeomObj.getFillColor()); | 405 | return this.application.ninja.colorController.colorModel.webGlToColor(el.elementModel.shapeModel.GLGeomObj.getFillColor()); |
406 | } | 406 | } |
@@ -497,28 +497,36 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
497 | webGl; | 497 | webGl; |
498 | if(isFill) | 498 | if(isFill) |
499 | { | 499 | { |
500 | if(mode) | 500 | // skip shape types that don't have fill color |
501 | if(el.elementModel.shapeModel.GLGeomObj.canFill) | ||
501 | { | 502 | { |
502 | switch (mode) { | 503 | if(mode) |
503 | case 'nocolor': | 504 | { |
504 | el.elementModel.shapeModel.GLGeomObj.setFillColor(null); | 505 | switch (mode) { |
505 | break; | 506 | case 'nocolor': |
506 | case 'gradient': | 507 | el.elementModel.shapeModel.GLGeomObj.setFillColor(null); |
507 | if(el.elementModel.shapeModel.useWebGl) | 508 | break; |
508 | { | 509 | case 'gradient': |
509 | this._setGradientMaterial(el, color.color.gradientMode, isFill); | 510 | if(el.elementModel.shapeModel.useWebGl) |
510 | } | 511 | { |
511 | el.elementModel.shapeModel.GLGeomObj.setFillColor({gradientMode:color.color.gradientMode, color:color.color.stops}); | 512 | this._setGradientMaterial(el, color.color.gradientMode, isFill); |
512 | break; | 513 | } |
513 | default: | 514 | el.elementModel.shapeModel.GLGeomObj.setFillColor({gradientMode:color.color.gradientMode, color:color.color.stops}); |
514 | if(el.elementModel.shapeModel.useWebGl) | 515 | break; |
515 | { | 516 | default: |
516 | this._setFlatMaterial(el, isFill); | 517 | if(el.elementModel.shapeModel.useWebGl) |
517 | } | 518 | { |
518 | webGl = this.application.ninja.colorController.colorModel.colorToWebGl(color.color); | 519 | this._setFlatMaterial(el, isFill); |
519 | el.elementModel.shapeModel.GLGeomObj.setFillColor(webGl); | 520 | } |
521 | webGl = this.application.ninja.colorController.colorModel.colorToWebGl(color.color); | ||
522 | el.elementModel.shapeModel.GLGeomObj.setFillColor(webGl); | ||
523 | } | ||
520 | } | 524 | } |
521 | } | 525 | } |
526 | else | ||
527 | { | ||
528 | return; | ||
529 | } | ||
522 | } | 530 | } |
523 | else | 531 | else |
524 | { | 532 | { |