Browse Source

Fixed a really mean bug in UI

master
Pete Shadbolt 7 years ago
parent
commit
d5ff4d0ae5
3 changed files with 4 additions and 2 deletions
  1. +1
    -1
      static/scripts/editor.js
  2. +1
    -0
      static/scripts/materials.js
  3. +2
    -1
      templates/doc.md

+ 1
- 1
static/scripts/editor.js View File

@@ -133,7 +133,7 @@ editor.onKey = function(evt) {
editor.gridTimeOut = 0;
}
if (evt.keyCode === 67) {
materials.curveProperties.splineDensity = materials.curveProperties.splineDensity == 10 ? 0 : 10;
materials.curveProperties.splineDensity = materials.curveProperties.splineDensity == 10 ? 1 : 10;
gui.render();
}
};


+ 1
- 0
static/scripts/materials.js View File

@@ -25,6 +25,7 @@ materials.prepare = function() {


materials.makeCurve = function(a, b) {
console.log("New curve, " + materials.curveProperties.splineDensity);
var length = new THREE.Vector3().subVectors(a, b).length();
var bend = new THREE.Vector3(length / materials.curveProperties.curvature, length / materials.curveProperties.curvature, 0);
var mid = new THREE.Vector3().add(a).add(b).multiplyScalar(0.5).add(bend);


+ 2
- 1
templates/doc.md View File

@@ -9,7 +9,8 @@ The state is initialized as a blank canvas without any qubits.
- Click on a qubit to view its properties
- Select a qubit, then <kbd>Shift</kbd>-click another node to act a CZ gate
- Press <kbd>Space</kbd> to rotate the grid
- Use the <kbd>Up</kbd> and <kbd>Down</kbd> arrow keys to move the grid normal to its plane.
- Use the up and down arrow keys to move the grid normal to its plane
- Press <kbd>C</kbd> to toggle curved edges

Arbitrary 3D structures can be constructed by rotating the grid.



Loading…
Cancel
Save