From 0d87bc86462cc595a3da2a800948692cc4d3e435 Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Wed, 4 Feb 2015 17:51:20 -0500
Subject: [PATCH] debugging

---
 js/fea/DmaCell.js    | 5 ++---
 js/models/Lattice.js | 7 ++++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/js/fea/DmaCell.js b/js/fea/DmaCell.js
index 8a23021f..6804d9be 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 9ddfb727..bf0862c2 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);
     }
 
 });
-- 
GitLab