aboutsummaryrefslogtreecommitdiff
path: root/js/lib/geom/line.js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-03-29 15:52:08 -0700
committerNivesh Rajbhandari2012-03-29 17:04:06 -0700
commit5b4f6b1618cf571a6bce5a631f976a008e04a64e (patch)
treed073038b08d14884f87c7776e9e192256d414cfb /js/lib/geom/line.js
parent6b61de58f0733b40f64ed996933ac89927e922a1 (diff)
downloadninja-5b4f6b1618cf571a6bce5a631f976a008e04a64e.tar.gz
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 <mqg734@motorola.com>
Diffstat (limited to 'js/lib/geom/line.js')
-rwxr-xr-xjs/lib/geom/line.js8
1 files changed, 8 insertions, 0 deletions
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
137 this._strokeStyle = jObj.strokeStyle; 137 this._strokeStyle = jObj.strokeStyle;
138 this._strokeColor = jObj.strokeColor; 138 this._strokeColor = jObj.strokeColor;
139 var strokeMaterialName = jObj.strokeMat; 139 var strokeMaterialName = jObj.strokeMat;
140
141 var strokeMat = MaterialsModel.getMaterial( strokeMaterialName );
142 if (!strokeMat) {
143 console.log( "object material not found in library: " + strokeMaterialName );
144 strokeMat = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() );
145 }
146 this._strokeMaterial = strokeMat;
147
140 this.importMaterialsJSON( jObj.materials ); 148 this.importMaterialsJSON( jObj.materials );
141 }; 149 };
142 150