From 7ed5215332123d16f819a7a26c651af520a68669 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 13 Apr 2012 16:37:19 -0700 Subject: Fixing the shape border Signed-off-by: Valerio Virgillito --- js/controllers/elements/shapes-controller.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'js/controllers/elements/shapes-controller.js') diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 14cdc473..cd7fa16d 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -74,12 +74,9 @@ exports.ShapesController = Montage.create(CanvasController, { w += delta; h += delta; } - this.application.ninja.elementMediator.setProperties([el], - { "left": [l + "px"], - "top": [t + "px"], - "width": [w + "px"], - "height": [h + "px"] }, - eventType, source ); + + this.application.ninja.elementMediator.setProperties([{element:el, properties:{left: l + "px", top: t + "px", width: w + "px", height:h + "px"}}], eventType, source); + } el.elementModel.shapeModel.GLGeomObj.setStrokeWidth(val); el.elementModel.shapeModel.GLGeomObj.buildBuffers(); -- cgit v1.2.3 From 2a87a750f06003fc62e8e0e73983e14ce24fc7a7 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 17 Apr 2012 10:19:20 -0700 Subject: IKNinja-1477 - Cannot preflight Fill color if WebGL Line shape is selected. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/shapes-controller.js | 50 ++++++++++++++++------------ 1 file changed, 29 insertions(+), 21 deletions(-) (limited to 'js/controllers/elements/shapes-controller.js') 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, { if(isFill) { // Properties Panel asks for fill color even for shapes that only have strokes - // Check that shape object has a getFillColor method before getting fills - if(el.elementModel.shapeModel.GLGeomObj.getFillColor) + // Check that shape object supports fills + if(el.elementModel.shapeModel.GLGeomObj.canFill) { return this.application.ninja.colorController.colorModel.webGlToColor(el.elementModel.shapeModel.GLGeomObj.getFillColor()); } @@ -497,28 +497,36 @@ exports.ShapesController = Montage.create(CanvasController, { webGl; if(isFill) { - if(mode) + // skip shape types that don't have fill color + if(el.elementModel.shapeModel.GLGeomObj.canFill) { - switch (mode) { - case 'nocolor': - el.elementModel.shapeModel.GLGeomObj.setFillColor(null); - break; - case 'gradient': - if(el.elementModel.shapeModel.useWebGl) - { - this._setGradientMaterial(el, color.color.gradientMode, isFill); - } - el.elementModel.shapeModel.GLGeomObj.setFillColor({gradientMode:color.color.gradientMode, color:color.color.stops}); - break; - default: - if(el.elementModel.shapeModel.useWebGl) - { - this._setFlatMaterial(el, isFill); - } - webGl = this.application.ninja.colorController.colorModel.colorToWebGl(color.color); - el.elementModel.shapeModel.GLGeomObj.setFillColor(webGl); + if(mode) + { + switch (mode) { + case 'nocolor': + el.elementModel.shapeModel.GLGeomObj.setFillColor(null); + break; + case 'gradient': + if(el.elementModel.shapeModel.useWebGl) + { + this._setGradientMaterial(el, color.color.gradientMode, isFill); + } + el.elementModel.shapeModel.GLGeomObj.setFillColor({gradientMode:color.color.gradientMode, color:color.color.stops}); + break; + default: + if(el.elementModel.shapeModel.useWebGl) + { + this._setFlatMaterial(el, isFill); + } + webGl = this.application.ninja.colorController.colorModel.colorToWebGl(color.color); + el.elementModel.shapeModel.GLGeomObj.setFillColor(webGl); + } } } + else + { + return; + } } else { -- cgit v1.2.3