From e7506dba6e4099aba779110f03e98074ba85d016 Mon Sep 17 00:00:00 2001 From: Pomax Date: Tue, 11 Aug 2020 18:25:25 -0700 Subject: [PATCH] don't interact if we're already moving points --- chapters/flattening/cubic.js | 2 +- chapters/flattening/quadratic.js | 2 +- chapters/whatis/interpolation.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chapters/flattening/cubic.js b/chapters/flattening/cubic.js index f34f1cb5..84552746 100644 --- a/chapters/flattening/cubic.js +++ b/chapters/flattening/cubic.js @@ -38,7 +38,7 @@ onKeyDown() { } onMouseMove() { - if (this.cursor.down) { + if (this.cursor.down && !this.currentPoint) { this.steps = round( map(this.cursor.y, 0,this.height, 24, 1) ); } redraw(); diff --git a/chapters/flattening/quadratic.js b/chapters/flattening/quadratic.js index d1213c26..f0219fb6 100644 --- a/chapters/flattening/quadratic.js +++ b/chapters/flattening/quadratic.js @@ -38,7 +38,7 @@ onKeyDown() { } onMouseMove() { - if (this.cursor.down) { + if (this.cursor.down && !this.currentPoint) { this.steps = round( map(this.cursor.y, 0,this.height, 16, 1) ); } redraw(); diff --git a/chapters/whatis/interpolation.js b/chapters/whatis/interpolation.js index f5e869de..0c04ac86 100644 --- a/chapters/whatis/interpolation.js +++ b/chapters/whatis/interpolation.js @@ -133,7 +133,7 @@ onMouseUp() { onMouseMove() { this.curve.update(); - if (this.mark) { + if (this.mark && !this.currentPoint) { let diff = this.mark - this.cursor.y, mapped = map(diff, -this.height/2, this.height/2, 10, 90, true); this.step = mapped | 0;