From 98a02c1ac6f189aba93d7cce64ba5bdbc0617f6c Mon Sep 17 00:00:00 2001 From: hwc487 Date: Tue, 20 Mar 2012 16:26:52 -0700 Subject: Bug Fixes for Canvas & WebGL File IO --- js/lib/geom/circle.js | 18 ------------------ js/lib/geom/geom-obj.js | 12 ++++++++++++ js/lib/geom/line.js | 11 +---------- js/lib/geom/rectangle.js | 28 ++++------------------------ 4 files changed, 17 insertions(+), 52 deletions(-) (limited to 'js/lib/geom') diff --git a/js/lib/geom/circle.js b/js/lib/geom/circle.js index fec62308..d48bf98b 100755 --- a/js/lib/geom/circle.js +++ b/js/lib/geom/circle.js @@ -634,24 +634,6 @@ var Circle = function GLCircle() { var strokeMaterialName = jObj.strokeMat; var fillMaterialName = jObj.fillMat; this.importMaterialsJSON( jObj.materials ); - - var strokeMat = MaterialsModel.getMaterial( strokeMaterialName ); - if (!strokeMat) { - console.log( "object material not found in library: " + strokeMaterialName ); - strokeMat = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ); - } - else - strokeMat = strokeMat.dup(); - this._strokeMaterial = strokeMat; - - var fillMat = MaterialsModel.getMaterial( fillMaterialName ); - if (!fillMat) { - console.log( "object material not found in library: " + fillMaterialName ); - fillMat = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ); - } - else - fillMat = fillMat.dup(); - this._fillMaterial = fillMat; }; 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() { this.importMaterialsJSON = function( jObj ) { + this._materialArray = []; + this._materialTypeArray = []; + + if (!jObj) return; + var nMaterials = jObj.nMaterials; var matArray = jObj.materials; for (var i=0; i