diff --git a/js/fea/DmaCell.js b/js/fea/DmaCell.js index 8a23021ff38ae657005ad2e9b427cce3eb4bc720..6804d9bec0575385d903279abda95dd1060c3557 100644 --- a/js/fea/DmaCell.js +++ b/js/fea/DmaCell.js @@ -55,8 +55,7 @@ DMACell.prototype._setCellMeshVisibility = function(visibility){ this.cellMesh.visible = visibility; }; -DMACell.prototype.updateForScale = function(){ - var scale = this.getScale(); +DMACell.prototype.updateForScale = function(scale){ this.cellMesh.scale.set(scale, scale, scale); var position = this._calcPosition(scale, this.indices); this._setMeshPosition(this.cellMesh, position); @@ -115,7 +114,7 @@ DMACell.prototype.destroy = function(){ function DMASideOctaCell(mode, indices, scale, lattice){ - DMACell.call(this, mode, indices, scale*(1-lattice.get("columnSeparation")), lattice); + DMACell.call(this, mode, indices, scale, lattice); } DMASideOctaCell.prototype = Object.create(DMACell.prototype); diff --git a/js/models/Lattice.js b/js/models/Lattice.js index 9ddfb7271fe54c4dc7f6d6ec1fcce29a4738c719..bf0862c28101bed063071e396b861f15dd80ede4 100644 --- a/js/models/Lattice.js +++ b/js/models/Lattice.js @@ -214,7 +214,7 @@ Lattice = Backbone.Model.extend({ var scale = this.get("scale"); this.get("basePlane").updateScale(scale); this._iterCells(this.get("cells"), function(cell){ - if (cell) cell.updateForScale(); + if (cell) cell.updateForScale(scale); }); window.three.render(); }, @@ -267,9 +267,10 @@ OctaFaceLattice = Lattice.extend({ _changeColSeparation: function(){ var colSep = this.get("columnSeparation"); + var scale = this.get("scale"); this.get("basePlane").updateColSeparation(colSep); this._iterCells(this.get("cells"), function(cell){ - if (cell) cell.updateForScale(); + if (cell) cell.updateForScale(scale); }); window.three.render(); }, @@ -290,7 +291,7 @@ OctaFaceLattice = Lattice.extend({ }, _makeCellForLatticeType: function(indices, scale){ - return new DMASideOctaCell(this.get("cellMode"), indices, scale*(1.0-2*this.get("columnSeparation")), this); + return new DMASideOctaCell(this.get("cellMode"), indices, scale, this); } });