diff --git a/js/models/lattice.js b/js/models/lattice.js index 5d414822bd8d0d8ee59b2b197a52df1274cf03b5..31b6a4e7257f514ff8170c7dde3cba2756ca3a9d 100644 --- a/js/models/lattice.js +++ b/js/models/lattice.js @@ -60,7 +60,7 @@ Lattice = Backbone.Model.extend({ } var index = this._subtract(position, this.get("cellsMin")); - cells[index.x][index.y][index.z] = new DMACell(this.get("cellMode"), position, scale); + if (!cells[index.x][index.y][index.z]) cells[index.x][index.y][index.z] = new DMACell(this.get("cellMode"), position, scale); this.set("numCells", this.get("numCells")+1); window.three.render(); }, diff --git a/js/threeViews/threeView.js b/js/threeViews/threeView.js index 00f3b6e66d1be0b1f90a8150ef2b438f641ca841..6e5c4774688e6ffc1ca65ae2fb595a7d010abf87 100644 --- a/js/threeViews/threeView.js +++ b/js/threeViews/threeView.js @@ -80,7 +80,7 @@ ThreeView = Backbone.View.extend({ _mouseUp: function(){ this.mouseIsDown = false; - if (this.highlighter.visible) this._addRemoveVoxel(!this.appState.get("deleteMode")); + this._addRemoveVoxel(!this.appState.get("deleteMode")); }, _mouseDown: function(){ @@ -179,7 +179,7 @@ ThreeView = Backbone.View.extend({ _addRemoveVoxel: function(shouldAdd){ if (shouldAdd){ -// if (!this.highlighter.visible) return; + if (!this.highlighter.visible) return; this.lattice.addCell(this.highlighter.geometry.vertices[0]); } else { if (this.currentIntersectedCell === this.basePlane) return;