diff options
Diffstat (limited to 'js/controllers/elements/shapes-controller.js')
-rwxr-xr-x | js/controllers/elements/shapes-controller.js | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 14cdc473..e9dde5fc 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js | |||
@@ -74,12 +74,9 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
74 | w += delta; | 74 | w += delta; |
75 | h += delta; | 75 | h += delta; |
76 | } | 76 | } |
77 | this.application.ninja.elementMediator.setProperties([el], | 77 | |
78 | { "left": [l + "px"], | 78 | this.application.ninja.elementMediator.setProperties([{element:el, properties:{left: l + "px", top: t + "px", width: w + "px", height:h + "px"}}], eventType, source); |
79 | "top": [t + "px"], | 79 | |
80 | "width": [w + "px"], | ||
81 | "height": [h + "px"] }, | ||
82 | eventType, source ); | ||
83 | } | 80 | } |
84 | el.elementModel.shapeModel.GLGeomObj.setStrokeWidth(val); | 81 | el.elementModel.shapeModel.GLGeomObj.setStrokeWidth(val); |
85 | el.elementModel.shapeModel.GLGeomObj.buildBuffers(); | 82 | el.elementModel.shapeModel.GLGeomObj.buildBuffers(); |
@@ -399,8 +396,8 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
399 | if(isFill) | 396 | if(isFill) |
400 | { | 397 | { |
401 | // 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 |
402 | // Check that shape object has a getFillColor method before getting fills | 399 | // Check that shape object supports fills |
403 | if(el.elementModel.shapeModel.GLGeomObj.getFillColor) | 400 | if(el.elementModel.shapeModel.GLGeomObj.canFill) |
404 | { | 401 | { |
405 | 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()); |
406 | } | 403 | } |
@@ -497,28 +494,36 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
497 | webGl; | 494 | webGl; |
498 | if(isFill) | 495 | if(isFill) |
499 | { | 496 | { |
500 | if(mode) | 497 | // skip shape types that don't have fill color |
498 | if(el.elementModel.shapeModel.GLGeomObj.canFill) | ||
501 | { | 499 | { |
502 | switch (mode) { | 500 | if(mode) |
503 | case 'nocolor': | 501 | { |
504 | el.elementModel.shapeModel.GLGeomObj.setFillColor(null); | 502 | switch (mode) { |
505 | break; | 503 | case 'nocolor': |
506 | case 'gradient': | 504 | el.elementModel.shapeModel.GLGeomObj.setFillColor(null); |
507 | if(el.elementModel.shapeModel.useWebGl) | 505 | break; |
508 | { | 506 | case 'gradient': |
509 | this._setGradientMaterial(el, color.color.gradientMode, isFill); | 507 | if(el.elementModel.shapeModel.useWebGl) |
510 | } | 508 | { |
511 | el.elementModel.shapeModel.GLGeomObj.setFillColor({gradientMode:color.color.gradientMode, color:color.color.stops}); | 509 | this._setGradientMaterial(el, color.color.gradientMode, isFill); |
512 | break; | 510 | } |
513 | default: | 511 | el.elementModel.shapeModel.GLGeomObj.setFillColor({gradientMode:color.color.gradientMode, color:color.color.stops}); |
514 | if(el.elementModel.shapeModel.useWebGl) | 512 | break; |
515 | { | 513 | default: |
516 | this._setFlatMaterial(el, isFill); | 514 | if(el.elementModel.shapeModel.useWebGl) |
517 | } | 515 | { |
518 | webGl = this.application.ninja.colorController.colorModel.colorToWebGl(color.color); | 516 | this._setFlatMaterial(el, isFill); |
519 | 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 | } | ||
520 | } | 521 | } |
521 | } | 522 | } |
523 | else | ||
524 | { | ||
525 | return; | ||
526 | } | ||
522 | } | 527 | } |
523 | else | 528 | else |
524 | { | 529 | { |