From 5b4f6b1618cf571a6bce5a631f976a008e04a64e Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 29 Mar 2012 15:52:08 -0700 Subject: Updated shapes to always check for its stroke and fill colors and materials instead of relying on the shapeModel cache because it can get out of sync. Signed-off-by: Nivesh Rajbhandari --- js/lib/geom/line.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'js/lib/geom/line.js') diff --git a/js/lib/geom/line.js b/js/lib/geom/line.js index e839e229..2b2434f5 100755 --- a/js/lib/geom/line.js +++ b/js/lib/geom/line.js @@ -137,6 +137,14 @@ var Line = function GLLine( world, xOffset, yOffset, width, height, slope, strok this._strokeStyle = jObj.strokeStyle; this._strokeColor = jObj.strokeColor; var strokeMaterialName = jObj.strokeMat; + + var strokeMat = MaterialsModel.getMaterial( strokeMaterialName ); + if (!strokeMat) { + console.log( "object material not found in library: " + strokeMaterialName ); + strokeMat = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ); + } + this._strokeMaterial = strokeMat; + this.importMaterialsJSON( jObj.materials ); }; -- cgit v1.2.3