From 3a8875c288049b466bfeb8b7f0510fd8cbfb970d Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 7 Feb 2012 13:30:08 -0800 Subject: Supporting switching materials in the PI. Also, moved makeFillMaterial and makeStrokeMaterial functions into GLGeomObj so shapes other than GLRectangle can use these routines. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/shapes-controller.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (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 21373aca..c6722dee 100644 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -108,7 +108,15 @@ exports.ShapesController = Montage.create(CanvasController, { return this.getShapeProperty(el, p); case "strokeMaterial": case "fillMaterial": - return this.getShapeProperty(el, p).getName(); + var m = this.getShapeProperty(el, p); + if(m) + { + return this.getShapeProperty(el, p).getName(); + } + else + { + return "FlatMaterial"; + } default: return CanvasController.getProperty(el, p); } -- cgit v1.2.3