From 8ad767b61460984a4031ba630f76ac8247a61857 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 7 Feb 2012 11:42:10 -0800 Subject: Fixed PI to support WebGL materials. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/shapes-controller.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 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 3f1ccc3d..21373aca 100644 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -68,6 +68,24 @@ exports.ShapesController = Montage.create(CanvasController, { this.toggleWebGlMode(el, value); el.elementModel.shapeModel.GLGeomObj.buildBuffers(); break; + case "strokeMaterial": + var sm = Object.create(MaterialsLibrary.getMaterial(value)); + if(sm) + { + el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(sm); + el.elementModel.shapeModel.strokeMaterial = sm; + el.elementModel.shapeModel.GLGeomObj.buildBuffers(); + } + break; + case "fillMaterial": + var fm = Object.create(MaterialsLibrary.getMaterial(value)); + if(fm) + { + el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm); + el.elementModel.shapeModel.strokeMaterial = fm; + el.elementModel.shapeModel.GLGeomObj.buildBuffers(); + } + break; default: CanvasController.setProperty(el, p, value); } @@ -84,12 +102,13 @@ exports.ShapesController = Montage.create(CanvasController, { case "trRadius": case "blRadius": case "brRadius": - case "strokeMaterial": - case "fillMaterial": case "border": case "background": case "useWebGl": return this.getShapeProperty(el, p); + case "strokeMaterial": + case "fillMaterial": + return this.getShapeProperty(el, p).getName(); default: return CanvasController.getProperty(el, p); } -- cgit v1.2.3