From 479817bf131468d5809067db67d1d56355cca263 Mon Sep 17 00:00:00 2001 From: Pete Shadbolt Date: Mon, 16 Oct 2017 18:26:06 -0700 Subject: [PATCH] Grid hiding --- static/scripts/editor.js | 9 +++++++++ static/scripts/mouse.js | 3 +++ 2 files changed, 12 insertions(+) diff --git a/static/scripts/editor.js b/static/scripts/editor.js index 6231cf5..94a4c4f 100644 --- a/static/scripts/editor.js +++ b/static/scripts/editor.js @@ -3,6 +3,8 @@ var pi2 = Math.PI / 2; editor.selection = undefined; editor.mouseOver = undefined; +editor.gridTimeOut = 0; + editor.orientations = [ new THREE.Euler(pi2, 0, 0), @@ -10,6 +12,11 @@ editor.orientations = [ new THREE.Euler(pi2, 0, pi2), ]; +editor.checkTimeOut = function() { + editor.gridTimeOut += 1; + console.log(editor.gridTimeOut); + editor.grid.visible = editor.gridTimeOut < 10; +} editor.onFreeMove = function() { var found = editor.findNodeOnRay(mouse.ray); @@ -198,3 +205,5 @@ editor.localComplementation = function() { abj.local_complementation(editor.selection); gui.serverMessage("Inverted neighbourhood of " + editor.selection + "."); }; + +setInterval(editor.checkTimeOut, 500); diff --git a/static/scripts/mouse.js b/static/scripts/mouse.js index 9f16ef4..a0b9ad2 100644 --- a/static/scripts/mouse.js +++ b/static/scripts/mouse.js @@ -70,4 +70,7 @@ mouse.onMove = function(event) { } else { mouse.onFreeMove(); } + + // Update editor + editor.gridTimeOut = 0; };