From 2edf68e0de786cdc92d5f41548fd61e6c77a57ec Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 13 Feb 2012 09:56:40 -0800 Subject: Updated ink bottle tool to use new setColor routine in the mediator and controllers. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/element-controller.js | 13 +++++++++++++ js/controllers/elements/shapes-controller.js | 8 ++++++++ 2 files changed, 21 insertions(+) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 65d26bdd..5eb75613 100644 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -115,6 +115,7 @@ var ElementController = exports.ElementController = Montage.create(NJComponent, } else { + // TODO - Need to update border style and width also el.elementModel.stroke = colorObj; } @@ -159,10 +160,22 @@ var ElementController = exports.ElementController = Montage.create(NJComponent, case 'gradient': this.setProperty(el, "border-image", color.color.css); this.setProperty(el, "border-color", "none"); + if(color.borderInfo) + { + this.setProperty(el, "border-width", color.borderInfo.borderWidth + + color.borderInfo.borderUnits); + this.setProperty(el, "border-style", color.borderInfo.borderStyle); + } break; default: this.setProperty(el, "border-image", "none"); this.setProperty(el, "border-color", color.color.css); + if(color.borderInfo) + { + this.setProperty(el, "border-width", color.borderInfo.borderWidth + + color.borderInfo.borderUnits); + this.setProperty(el, "border-style", color.borderInfo.borderStyle); + } } } el.elementModel.stroke = color; diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 640119c4..42c2528f 100644 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -260,6 +260,14 @@ exports.ShapesController = Montage.create(CanvasController, { el.elementModel.shapeModel.GLGeomObj.setStrokeColor(webGl); this.setShapeProperty(el, "stroke", webGl); this.setShapeProperty(el, "border", color); + if(color.strokeInfo) + { + var strokeWidth = this.GetValueInPixels(color.strokeInfo.strokeSize, + color.strokeInfo.strokeUnits); + el.elementModel.shapeModel.GLGeomObj.setStrokeWidth(strokeWidth); + this.setShapeProperty(el, "strokeSize", color.strokeInfo.strokeSize + " " + + color.strokeInfo.strokeUnits); + } } el.elementModel.shapeModel.GLWorld.render(); } -- cgit v1.2.3 From c0ab12c07d18149e3704d3e5f66aee43c13b7fd0 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 13 Feb 2012 11:57:04 -0800 Subject: Working around inconsistent color object when getting/setting WebGL values. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/shapes-controller.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 42c2528f..8953f155 100644 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -249,6 +249,10 @@ exports.ShapesController = Montage.create(CanvasController, { setColor: { value: function(el, color, isFill) { var webGl = color.webGlColor || color.color.webGlColor; + if(!webGl) + { + webGl = this.application.ninja.colorController.colorModel.colorToWebGl(color.color); + } if(isFill) { el.elementModel.shapeModel.GLGeomObj.setFillColor(webGl); -- cgit v1.2.3