aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-04-02 13:16:27 -0700
committerNivesh Rajbhandari2012-04-02 13:16:27 -0700
commitc4e83a61311db75c7a1c307553262e77ecaae662 (patch)
tree68bdcbaa6af2488dd708de7675f0c5f51066d109 /js/controllers/elements
parentc2e9ed5bc4cbef870283784fa2a91f43ff72cade (diff)
downloadninja-c4e83a61311db75c7a1c307553262e77ecaae662.tar.gz
IKNinna-1409 - Should dirty document when changing shape properties. IKNinja-1391 - Shapes need to support no-color.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/controllers/elements')
-rwxr-xr-xjs/controllers/elements/shapes-controller.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index a4d53e50..5d3cf060 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -78,6 +78,7 @@ exports.ShapesController = Montage.create(CanvasController, {
78 this.toggleWebGlMode(el, value); 78 this.toggleWebGlMode(el, value);
79 el.elementModel.shapeModel.GLWorld.render(); 79 el.elementModel.shapeModel.GLWorld.render();
80 this.application.ninja.selectionController.selectElement(el); 80 this.application.ninja.selectionController.selectElement(el);
81 this.application.ninja.documentController.activeDocument.needsSave = true;
81 return; 82 return;
82 case "strokeMaterial": 83 case "strokeMaterial":
83 var sm = Object.create(MaterialsModel.getMaterial(value)); 84 var sm = Object.create(MaterialsModel.getMaterial(value));
@@ -145,6 +146,7 @@ exports.ShapesController = Montage.create(CanvasController, {
145 default: 146 default:
146 CanvasController.setProperty(el, p, value); 147 CanvasController.setProperty(el, p, value);
147 } 148 }
149 this.application.ninja.documentController.activeDocument.needsSave = true;
148 } 150 }
149 }, 151 },
150 152
@@ -422,8 +424,7 @@ exports.ShapesController = Montage.create(CanvasController, {
422 setColor: { 424 setColor: {
423 value: function(el, color, isFill) { 425 value: function(el, color, isFill) {
424 var mode = color.mode, 426 var mode = color.mode,
425 webGl, 427 webGl;
426 m;
427 if(isFill) 428 if(isFill)
428 { 429 {
429 if(mode) 430 if(mode)
@@ -431,14 +432,13 @@ exports.ShapesController = Montage.create(CanvasController, {
431 switch (mode) { 432 switch (mode) {
432 case 'nocolor': 433 case 'nocolor':
433 el.elementModel.shapeModel.GLGeomObj.setFillColor(null); 434 el.elementModel.shapeModel.GLGeomObj.setFillColor(null);
434 return; 435 break;
435 case 'gradient': 436 case 'gradient':
436 if(el.elementModel.shapeModel.useWebGl) 437 if(el.elementModel.shapeModel.useWebGl)
437 { 438 {
438 this._setGradientMaterial(el, color.color.gradientMode, isFill); 439 this._setGradientMaterial(el, color.color.gradientMode, isFill);
439 } 440 }
440 el.elementModel.shapeModel.GLGeomObj.setFillColor({gradientMode:color.color.gradientMode, color:color.color.stops}); 441 el.elementModel.shapeModel.GLGeomObj.setFillColor({gradientMode:color.color.gradientMode, color:color.color.stops});
441 el.elementModel.shapeModel.GLWorld.render();
442 break; 442 break;
443 default: 443 default:
444 if(el.elementModel.shapeModel.useWebGl) 444 if(el.elementModel.shapeModel.useWebGl)
@@ -447,7 +447,6 @@ exports.ShapesController = Montage.create(CanvasController, {
447 } 447 }
448 webGl = this.application.ninja.colorController.colorModel.colorToWebGl(color.color); 448 webGl = this.application.ninja.colorController.colorModel.colorToWebGl(color.color);
449 el.elementModel.shapeModel.GLGeomObj.setFillColor(webGl); 449 el.elementModel.shapeModel.GLGeomObj.setFillColor(webGl);
450 el.elementModel.shapeModel.GLWorld.render();
451 } 450 }
452 } 451 }
453 } 452 }
@@ -468,14 +467,13 @@ exports.ShapesController = Montage.create(CanvasController, {
468 switch (mode) { 467 switch (mode) {
469 case 'nocolor': 468 case 'nocolor':
470 el.elementModel.shapeModel.GLGeomObj.setStrokeColor(null); 469 el.elementModel.shapeModel.GLGeomObj.setStrokeColor(null);
471 return; 470 break;
472 case 'gradient': 471 case 'gradient':
473 if(el.elementModel.shapeModel.useWebGl) 472 if(el.elementModel.shapeModel.useWebGl)
474 { 473 {
475 this._setGradientMaterial(el, color.color.gradientMode, isFill); 474 this._setGradientMaterial(el, color.color.gradientMode, isFill);
476 } 475 }
477 el.elementModel.shapeModel.GLGeomObj.setStrokeColor({gradientMode:color.color.gradientMode, color:color.color.stops}); 476 el.elementModel.shapeModel.GLGeomObj.setStrokeColor({gradientMode:color.color.gradientMode, color:color.color.stops});
478 el.elementModel.shapeModel.GLWorld.render();
479 break; 477 break;
480 default: 478 default:
481 if(el.elementModel.shapeModel.useWebGl) 479 if(el.elementModel.shapeModel.useWebGl)
@@ -484,11 +482,11 @@ exports.ShapesController = Montage.create(CanvasController, {
484 } 482 }
485 webGl = this.application.ninja.colorController.colorModel.colorToWebGl(color.color); 483 webGl = this.application.ninja.colorController.colorModel.colorToWebGl(color.color);
486 el.elementModel.shapeModel.GLGeomObj.setStrokeColor(webGl); 484 el.elementModel.shapeModel.GLGeomObj.setStrokeColor(webGl);
487 el.elementModel.shapeModel.GLWorld.render();
488 } 485 }
489 } 486 }
490 } 487 }
491 el.elementModel.shapeModel.GLWorld.render(); 488 el.elementModel.shapeModel.GLWorld.render();
489 this.application.ninja.documentController.activeDocument.needsSave = true;
492 } 490 }
493 }, 491 },
494 492