diff options
author | Nivesh Rajbhandari | 2012-03-29 15:52:08 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-03-29 17:04:06 -0700 |
commit | 5b4f6b1618cf571a6bce5a631f976a008e04a64e (patch) | |
tree | d073038b08d14884f87c7776e9e192256d414cfb /js/lib/geom/rectangle.js | |
parent | 6b61de58f0733b40f64ed996933ac89927e922a1 (diff) | |
download | ninja-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/rectangle.js')
-rwxr-xr-x | js/lib/geom/rectangle.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/js/lib/geom/rectangle.js b/js/lib/geom/rectangle.js index e511d5f4..b01aea53 100755 --- a/js/lib/geom/rectangle.js +++ b/js/lib/geom/rectangle.js | |||
@@ -290,6 +290,21 @@ var Rectangle = function GLRectangle() { | |||
290 | this._strokeStyle = jObj.strokeStyle; | 290 | this._strokeStyle = jObj.strokeStyle; |
291 | var strokeMaterialName = jObj.strokeMat; | 291 | var strokeMaterialName = jObj.strokeMat; |
292 | var fillMaterialName = jObj.fillMat; | 292 | var fillMaterialName = jObj.fillMat; |
293 | |||
294 | var strokeMat = MaterialsModel.getMaterial( strokeMaterialName ); | ||
295 | if (!strokeMat) { | ||
296 | console.log( "object material not found in library: " + strokeMaterialName ); | ||
297 | strokeMat = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ); | ||
298 | } | ||
299 | this._strokeMaterial = strokeMat; | ||
300 | |||
301 | var fillMat = MaterialsModel.getMaterial( fillMaterialName ); | ||
302 | if (!fillMat) { | ||
303 | console.log( "object material not found in library: " + fillMaterialName ); | ||
304 | fillMat = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ); | ||
305 | } | ||
306 | this._fillMaterial = fillMat; | ||
307 | |||
293 | this.importMaterialsJSON( jObj.materials ); | 308 | this.importMaterialsJSON( jObj.materials ); |
294 | }; | 309 | }; |
295 | 310 | ||