From d5ff4d0ae51ebc94e3ad2d5d20bd054fb839fd6b Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Wed, 25 Oct 2017 04:26:44 -0700 Subject: [PATCH] Fixed a really mean bug in UI --- static/scripts/editor.js | 2 +- static/scripts/materials.js | 1 + templates/doc.md | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/static/scripts/editor.js b/static/scripts/editor.js index d08185c..d676cf2 100644 --- a/static/scripts/editor.js +++ b/static/scripts/editor.js @@ -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(); } }; diff --git a/static/scripts/materials.js b/static/scripts/materials.js index 5c0bca6..31cf9f1 100644 --- a/static/scripts/materials.js +++ b/static/scripts/materials.js @@ -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); diff --git a/templates/doc.md b/templates/doc.md index 87263f0..2294dac 100644 --- a/templates/doc.md +++ b/templates/doc.md @@ -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 Shift-click another node to act a CZ gate - Press Space to rotate the grid -- Use the Up and Down 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 C to toggle curved edges Arbitrary 3D structures can be constructed by rotating the grid.