diff options
Diffstat (limited to 'js/lib/geom/rectangle.js')
-rwxr-xr-x | js/lib/geom/rectangle.js | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/js/lib/geom/rectangle.js b/js/lib/geom/rectangle.js index c6bc2d88..38e428bd 100755 --- a/js/lib/geom/rectangle.js +++ b/js/lib/geom/rectangle.js | |||
@@ -78,8 +78,6 @@ var Rectangle = function GLRectangle() { | |||
78 | } else { | 78 | } else { |
79 | this._fillMaterial = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ); | 79 | this._fillMaterial = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ); |
80 | } | 80 | } |
81 | |||
82 | this.exportMaterials(); | ||
83 | }; | 81 | }; |
84 | 82 | ||
85 | /////////////////////////////////////////////////////////////////////// | 83 | /////////////////////////////////////////////////////////////////////// |
@@ -291,24 +289,6 @@ var Rectangle = function GLRectangle() { | |||
291 | var strokeMaterialName = jObj.strokeMat; | 289 | var strokeMaterialName = jObj.strokeMat; |
292 | var fillMaterialName = jObj.fillMat; | 290 | var fillMaterialName = jObj.fillMat; |
293 | this.importMaterialsJSON( jObj.materials ); | 291 | this.importMaterialsJSON( jObj.materials ); |
294 | |||
295 | var strokeMat = MaterialsModel.getMaterial( strokeMaterialName ); | ||
296 | if (!strokeMat) { | ||
297 | console.log( "object material not found in library: " + strokeMaterialName ); | ||
298 | strokeMat = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ); | ||
299 | } | ||
300 | else | ||
301 | strokeMat = strokeMat.dup(); | ||
302 | this._strokeMaterial = strokeMat; | ||
303 | |||
304 | var fillMat = MaterialsModel.getMaterial( fillMaterialName ); | ||
305 | if (!fillMat) { | ||
306 | console.log( "object material not found in library: " + fillMaterialName ); | ||
307 | fillMat = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ); | ||
308 | } | ||
309 | else | ||
310 | fillMat = fillMat.dup(); | ||
311 | this._fillMaterial = fillMat; | ||
312 | }; | 292 | }; |
313 | 293 | ||
314 | this.import = function( importStr ) { | 294 | this.import = function( importStr ) { |
@@ -430,10 +410,10 @@ var Rectangle = function GLRectangle() { | |||
430 | brRadius = -z*(r-l)/(2.0*zn)*brRadiusNDC; | 410 | brRadius = -z*(r-l)/(2.0*zn)*brRadiusNDC; |
431 | 411 | ||
432 | // stroke | 412 | // stroke |
433 | // var strokeMaterial = this.makeStrokeMaterial(); | 413 | var strokeMaterial = this.makeStrokeMaterial(); |
434 | // var strokePrim = this.createStroke([x,y], 2*xFill, 2*yFill, strokeSize, tlRadius, blRadius, brRadius, trRadius, strokeMaterial); | 414 | var strokePrim = this.createStroke([x,y], 2*xFill, 2*yFill, strokeSize, tlRadius, blRadius, brRadius, trRadius, strokeMaterial); |
435 | // this._primArray.push( strokePrim ); | 415 | this._primArray.push( strokePrim ); |
436 | // this._materialNodeArray.push( strokeMaterial.getMaterialNode() ); | 416 | this._materialNodeArray.push( strokeMaterial.getMaterialNode() ); |
437 | 417 | ||
438 | // fill | 418 | // fill |
439 | tlRadius -= strokeSize; if (tlRadius < 0) tlRadius = 0.0; | 419 | tlRadius -= strokeSize; if (tlRadius < 0) tlRadius = 0.0; |