summaryrefslogtreecommitdiff
path: root/tools/mq_editor/editor.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mq_editor/editor.js')
-rw-r--r--tools/mq_editor/editor.js15
1 files changed, 2 insertions, 13 deletions
diff --git a/tools/mq_editor/editor.js b/tools/mq_editor/editor.js
index 0854ec0..a7d0879 100644
--- a/tools/mq_editor/editor.js
+++ b/tools/mq_editor/editor.js
@@ -25,8 +25,7 @@ class PartialEditor {
// Private state
this._selectedIndex = -1;
- this._dragPointIndex = -1;
- this._dragCompanionOff = null; // {dt, dv} offset of companion handle relative to anchor
+ this._dragPointIndex = -1;
this._amp = { tMin: 0, tMax: 1, ampTop: 1 };
this._setupButtons();
@@ -496,12 +495,7 @@ class PartialEditor {
for (let i = 0; i < 4; ++i) {
if (Math.hypot(this._tToX(curve['t' + i]) - x, this._ampToY(curve['a' + i]) - y) <= 8) {
if (this.onBeforeChange) this.onBeforeChange();
- this._dragPointIndex = i;
- this._dragCompanionOff = null;
- if (i === 0)
- this._dragCompanionOff = { da: curve.a1 - curve.a0 };
- else if (i === 3)
- this._dragCompanionOff = { da: curve.a2 - curve.a3 };
+ this._dragPointIndex = i;
canvas.style.cursor = 'grabbing';
e.preventDefault();
return;
@@ -516,11 +510,6 @@ class PartialEditor {
const curve = this.partials[this._selectedIndex].freqCurve;
const i = this._dragPointIndex;
curve['a' + i] = Math.max(0, this._yToAmp(y));
- if (this._dragCompanionOff) {
- const off = this._dragCompanionOff;
- if (i === 0) { curve.a1 = curve.a0 + off.da; }
- else { curve.a2 = curve.a3 + off.da; }
- }
this._renderAmpEditor();
if (this.viewer) this.viewer.render();
e.preventDefault();