aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements
diff options
context:
space:
mode:
authorPushkar Joshi2012-04-19 14:12:45 -0700
committerPushkar Joshi2012-04-19 14:12:45 -0700
commit9f32d7e5454db3189209fc68a286a7fdb0c31fe8 (patch)
treea51c2bf67839a25158c30752b44fdea0eac28b9d /js/controllers/elements
parentdc1e8dde18c40cf740bd2fe09165784e0d415fab (diff)
parent6d33345a9e609e36539d2efa25569f5eeb04a2af (diff)
downloadninja-9f32d7e5454db3189209fc68a286a7fdb0c31fe8.tar.gz
Merge branch 'master' into pentool
Conflicts: js/helper-classes/3D/view-utils.js
Diffstat (limited to 'js/controllers/elements')
-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 {