diff --git a/js/cells/supercells/CompositeCell.js b/js/cells/supercells/CompositeCell.js index 46d2b7f4709d0f713c293e5481e986ca9fb1f45e..743ac1837681a2ed82b3e5b4fa859c7948cd0fae 100644 --- a/js/cells/supercells/CompositeCell.js +++ b/js/cells/supercells/CompositeCell.js @@ -13,7 +13,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'superCell', CompositeCell.prototype._getGeometry = function(){ var dimensions = globals.materials.compositeMaterials[this.material].dimensions; - var geo = new THREE.BoxGeometry(dimensions.x, dimensions.y, dimensions.z); + var geo = new THREE.BoxGeometry(dimensions.x*lattice.xScale(), dimensions.y*lattice.yScale(), dimensions.z*lattice.zScale()); geo.applyMatrix(new THREE.Matrix4().makeTranslation(dimensions.x/2-0.5, dimensions.y/2-0.5, dimensions.z/2-0.5)); return geo; }; diff --git a/js/lattice/Lattice.js b/js/lattice/Lattice.js index f9df850cb9958dd529b82bf3e432253085cb1332..257406936f4c15d8ba6cf4f2771a655a79a013f5 100644 --- a/js/lattice/Lattice.js +++ b/js/lattice/Lattice.js @@ -65,6 +65,8 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre _setDefaultCellMode: function(){//if no part associated with this lattice type if (!plist["allPartTypes"][this.get("cellType")][this.get("connectionType")]){ + var currentMode = appState.get("cellMode"); + if (currentMode == "cell" || currentMode == "supercell") return; appState.set("cellMode", "cell"); } },