~smitop/eigen.fun

98378ec3001e03c71c881ac0ffb5fd8f81a62d4e — Smitty 2 years ago 0ae009c
Only update cursor state framely
1 files changed, 6 insertions(+), 5 deletions(-)

M public/script.js
M public/script.js => public/script.js +6 -5
@@ 46,11 46,6 @@ const ARROW_ANGLE_DIV = 6; // arrow angle

function stateUpdated() {
    // TODO: save state
    if (state.selected !== null) {
        can.style.cursor = "move";
    } else {
        can.style.cursor = "auto";
    }
    state.rendering.dirty = true;
}



@@ 292,6 287,12 @@ function render() {
    state.jhat = transState.jhat;
    if (transState.done) state.curTransition = null;

    if (state.selected !== null) {
        can.style.cursor = "move";
    } else {
        can.style.cursor = "auto";
    }

    // grid
    ctx.clearRect(0, 0, can.width, can.height);
    const det = getDet();