diff --git a/css/main.css b/css/main.css index 880dcf2456c8e17004f8d8de15dabbd42f6c337c..d79cb8f33f9236b24fdfc0d65d3df619e8a02a6a 100644 --- a/css/main.css +++ b/css/main.css @@ -216,7 +216,7 @@ hr { } input.intInput, input.floatInput{ - width:22%; + width:21%; display: inline; padding: 8px 8px; } diff --git a/js/menus/LatticeMenuView.js b/js/menus/LatticeMenuView.js index 4aaa1845d6f4280b2475e3cf81515ae1b0430fe7..f4978aa26c506f82313c0c4590cb58ebb250a566 100644 --- a/js/menus/LatticeMenuView.js +++ b/js/menus/LatticeMenuView.js @@ -16,7 +16,9 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice', 'text!latticeM }, _makeTemplateJSON: function(){ - return _.extend(_.extend(lattice.toJSON(), this.model.toJSON()), plist); + var aspectRatio = {aspectRatio: {x:1,y:1,z:1}}; + if (lattice.xScale) aspectRatio = {aspectRatio: {x:lattice.xScale(0), y:lattice.yScale(0), z:lattice.zScale(0)}}; + return _.extend(_.extend(lattice.toJSON(), this.model.toJSON()), plist, aspectRatio); }, template: _.template(template) diff --git a/js/menus/templates/LatticeMenuView.html b/js/menus/templates/LatticeMenuView.html index 9bf394ae41a37d1f6a655867fc9cf31796ea31fe..9b3c6d2430c7782a99a99cb1ff022b2361d23dd7 100644 --- a/js/menus/templates/LatticeMenuView.html +++ b/js/menus/templates/LatticeMenuView.html @@ -16,6 +16,10 @@ Cell Connection: <% }); %> </ul> </div><br/><br/> +Aspect Ratio: + <input data-property="aspectRatio" data-key="x" value="<%= aspectRatio.x %>" placeholder="X" class="form-control floatInput" type="text"> + <input data-property="aspectRatio" data-key="y" value="<%= aspectRatio.y %>" placeholder="Y" class="form-control floatInput" type="text"> + <input data-property="aspectRatio" data-key="z" value="<%= aspectRatio.z %>" placeholder="Z" class="form-control floatInput" type="text"><br/><br/> <% if (connectionType == "gik") { %> GIK Length: <input data-property="gikLength" value="<%= gikLength %>" placeholder="GIK length" class="form-control intInput appState" type="text"><br/><br/> <% } %>