aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorValerio Virgillito2012-04-17 15:27:36 -0700
committerValerio Virgillito2012-04-17 15:27:36 -0700
commit616a8532099fec2a15855eac97cd85cb60c4451c (patch)
tree8f54b42024a7d0ab2c6a0e37884b9af3c2d94451 /js/controllers
parentcacb4a21825818af392c2949967b0f3c1df509c5 (diff)
parent078208d02205f54808db888bbdbe5f69b3abba4b (diff)
downloadninja-616a8532099fec2a15855eac97cd85cb60c4451c.tar.gz
Merge pull request #166 from mqg734/WebGLFixes
IKNinja-1477 - Cannot preflight Fill color if WebGL Line shape is selected.
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/elements/canvas-controller.js8
-rwxr-xr-xjs/controllers/elements/shapes-controller.js50
2 files changed, 37 insertions, 21 deletions
diff --git a/js/controllers/elements/canvas-controller.js b/js/controllers/elements/canvas-controller.js
index 7af7e824..b8894c18 100755
--- a/js/controllers/elements/canvas-controller.js
+++ b/js/controllers/elements/canvas-controller.js
@@ -33,5 +33,13 @@ exports.CanvasController = Montage.create(ElementController, {
33 ElementController.setProperty(el, p, value); 33 ElementController.setProperty(el, p, value);
34 } 34 }
35 } 35 }
36 },
37
38 setProperties: {
39 value: function(element, properties) {
40 for(var property in properties) {
41 this.setProperty(element, property, properties[property]);
42 }
43 }
36 } 44 }
37}); \ No newline at end of file 45}); \ No newline at end of file
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index cd7fa16d..e9dde5fc 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -396,8 +396,8 @@ exports.ShapesController = Montage.create(CanvasController, {
396 if(isFill) 396 if(isFill)
397 { 397 {
398 // Properties Panel asks for fill color even for shapes that only have strokes 398 // Properties Panel asks for fill color even for shapes that only have strokes
399 // Check that shape object has a getFillColor method before getting fills 399 // Check that shape object supports fills
400 if(el.elementModel.shapeModel.GLGeomObj.getFillColor) 400 if(el.elementModel.shapeModel.GLGeomObj.canFill)
401 { 401 {
402 return this.application.ninja.colorController.colorModel.webGlToColor(el.elementModel.shapeModel.GLGeomObj.getFillColor()); 402 return this.application.ninja.colorController.colorModel.webGlToColor(el.elementModel.shapeModel.GLGeomObj.getFillColor());
403 } 403 }
@@ -494,28 +494,36 @@ exports.ShapesController = Montage.create(CanvasController, {
494 webGl; 494 webGl;
495 if(isFill) 495 if(isFill)
496 { 496 {
497 if(mode) 497 // skip shape types that don't have fill color
498 if(el.elementModel.shapeModel.GLGeomObj.canFill)
498 { 499 {
499 switch (mode) { 500 if(mode)
500 case 'nocolor': 501 {
501 el.elementModel.shapeModel.GLGeomObj.setFillColor(null); 502 switch (mode) {
502 break; 503 case 'nocolor':
503 case 'gradient': 504 el.elementModel.shapeModel.GLGeomObj.setFillColor(null);
504 if(el.elementModel.shapeModel.useWebGl) 505 break;
505 { 506 case 'gradient':
506 this._setGradientMaterial(el, color.color.gradientMode, isFill); 507 if(el.elementModel.shapeModel.useWebGl)
507 } 508 {
508 el.elementModel.shapeModel.GLGeomObj.setFillColor({gradientMode:color.color.gradientMode, color:color.color.stops}); 509 this._setGradientMaterial(el, color.color.gradientMode, isFill);
509 break; 510 }
510 default: 511 el.elementModel.shapeModel.GLGeomObj.setFillColor({gradientMode:color.color.gradientMode, color:color.color.stops});
511 if(el.elementModel.shapeModel.useWebGl) 512 break;
512 { 513 default:
513 this._setFlatMaterial(el, isFill); 514 if(el.elementModel.shapeModel.useWebGl)
514 } 515 {
515 webGl = this.application.ninja.colorController.colorModel.colorToWebGl(color.color); 516 this._setFlatMaterial(el, isFill);
516 el.elementModel.shapeModel.GLGeomObj.setFillColor(webGl); 517 }
518 webGl = this.application.ninja.colorController.colorModel.colorToWebGl(color.color);
519 el.elementModel.shapeModel.GLGeomObj.setFillColor(webGl);
520 }
517 } 521 }
518 } 522 }
523 else
524 {
525 return;
526 }
519 } 527 }
520 else 528 else
521 { 529 {