aboutsummaryrefslogtreecommitdiff
path: root/js/lib/geom/geom-obj.js
diff options
context:
space:
mode:
authorhwc4872012-03-20 16:26:52 -0700
committerhwc4872012-03-20 16:26:52 -0700
commit98a02c1ac6f189aba93d7cce64ba5bdbc0617f6c (patch)
tree93a3fc2c1aaffb97edeecc890e5540f7d15ad838 /js/lib/geom/geom-obj.js
parent43ea2515f1482eeb77454f407111f0568c056f72 (diff)
downloadninja-98a02c1ac6f189aba93d7cce64ba5bdbc0617f6c.tar.gz
Bug Fixes for Canvas & WebGL File IO
Diffstat (limited to 'js/lib/geom/geom-obj.js')
-rwxr-xr-xjs/lib/geom/geom-obj.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/lib/geom/geom-obj.js b/js/lib/geom/geom-obj.js
index 63f71955..75b7808b 100755
--- a/js/lib/geom/geom-obj.js
+++ b/js/lib/geom/geom-obj.js
@@ -279,6 +279,11 @@ var GeomObj = function GLGeomObj() {
279 279
280 this.importMaterialsJSON = function( jObj ) 280 this.importMaterialsJSON = function( jObj )
281 { 281 {
282 this._materialArray = [];
283 this._materialTypeArray = [];
284
285 if (!jObj) return;
286
282 var nMaterials = jObj.nMaterials; 287 var nMaterials = jObj.nMaterials;
283 var matArray = jObj.materials; 288 var matArray = jObj.materials;
284 for (var i=0; i<nMaterials; i++) 289 for (var i=0; i<nMaterials; i++)
@@ -318,7 +323,14 @@ var GeomObj = function GLGeomObj() {
318 } 323 }
319 324
320 if (mat) 325 if (mat)
326 {
321 mat.importJSON( matObj ); 327 mat.importJSON( matObj );
328 this._materialArray.push( mat );
329 this._materialTypeArray.push( matObj.type );
330 var type = matArray[i].type;
331 if (type == "fill") this._fillMaterial = mat;
332 else this._strokeMaterial = mat;
333 }
322 } 334 }
323 } 335 }
324 336