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/circle.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/circle.js')
-rwxr-xr-x | js/lib/geom/circle.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/js/lib/geom/circle.js b/js/lib/geom/circle.js index d48bf98b..ee3e2abd 100755 --- a/js/lib/geom/circle.js +++ b/js/lib/geom/circle.js | |||
@@ -633,6 +633,21 @@ var Circle = function GLCircle() { | |||
633 | this._strokeStyle = jObj.strokeStyle; | 633 | this._strokeStyle = jObj.strokeStyle; |
634 | var strokeMaterialName = jObj.strokeMat; | 634 | var strokeMaterialName = jObj.strokeMat; |
635 | var fillMaterialName = jObj.fillMat; | 635 | var fillMaterialName = jObj.fillMat; |
636 | |||
637 | var strokeMat = MaterialsModel.getMaterial( strokeMaterialName ); | ||
638 | if (!strokeMat) { | ||
639 | console.log( "object material not found in library: " + strokeMaterialName ); | ||
640 | strokeMat = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ); | ||
641 | } | ||
642 | this._strokeMaterial = strokeMat; | ||
643 | |||
644 | var fillMat = MaterialsModel.getMaterial( fillMaterialName ); | ||
645 | if (!fillMat) { | ||
646 | console.log( "object material not found in library: " + fillMaterialName ); | ||
647 | fillMat = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ); | ||
648 | } | ||
649 | this._fillMaterial = fillMat; | ||
650 | |||
636 | this.importMaterialsJSON( jObj.materials ); | 651 | this.importMaterialsJSON( jObj.materials ); |
637 | }; | 652 | }; |
638 | 653 | ||