From 619c8b21d310703fa19370a775572e7c31a3f97b Mon Sep 17 00:00:00 2001 From: Amanda Ghassaei <amandaghassaei@gmail.com> Date: Tue, 16 Jun 2015 09:42:17 -0700 Subject: [PATCH] fixed super cell highlighter defaults --- js/highlighter/SuperCellHighlighter.js | 13 ++++++++----- js/models/AppState.js | 1 - 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/js/highlighter/SuperCellHighlighter.js b/js/highlighter/SuperCellHighlighter.js index 85eaa359..81edab6a 100644 --- a/js/highlighter/SuperCellHighlighter.js +++ b/js/highlighter/SuperCellHighlighter.js @@ -37,12 +37,15 @@ define(['underscore', 'backbone', 'threeModel', 'appState', 'lattice', 'cell', ' }, _setRotation: function(direction){ - if (!this.highlightedObject) return; - var index = this.highlightedObject.getAbsoluteIndex(); - if ((index.z%2 == 0 && Math.abs(direction.z) > 0.9) || (index.z%2 != 0 && Math.abs(direction.z) < 0.1)) - this.mesh.rotation.set(0, 0, Math.PI/2); - else this.mesh.rotation.set(0,0,0); + if (lattice.connectionType == "gik"){ + if (!this.highlightedObject) return; + var index = this.highlightedObject.getAbsoluteIndex(); + + if ((index.z%2 == 0 && Math.abs(direction.z) > 0.9) || (index.z%2 != 0 && Math.abs(direction.z) < 0.1)) + this.mesh.rotation.set(0, 0, Math.PI/2); + else this.mesh.rotation.set(0,0,0); + } var superCellIndex = appState.get("superCellIndex"); this.mesh.translateX(-(superCellIndex.x + 0.5 - this.mesh.scale.x/2)*lattice.xScale()); diff --git a/js/models/AppState.js b/js/models/AppState.js index 126278b7..c54e1207 100644 --- a/js/models/AppState.js +++ b/js/models/AppState.js @@ -195,7 +195,6 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist'], function(_, B } break; case 87://w - increase supercell index - console.log(this.get("superCellIndex")); if (state) this.set("superCellIndex", this._incrementSuperCellIndex("x", this.get("superCellIndex").clone())); break; case 81://q - decrease supercell index -- GitLab