summaryrefslogtreecommitdiff
path: root/tools/mq_editor/viewer.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mq_editor/viewer.js')
-rw-r--r--tools/mq_editor/viewer.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/mq_editor/viewer.js b/tools/mq_editor/viewer.js
index 723a585..46876c1 100644
--- a/tools/mq_editor/viewer.js
+++ b/tools/mq_editor/viewer.js
@@ -53,6 +53,7 @@ class SpectrogramViewer {
this.dragState = null; // {pointIndex: 0-3}
this.onPartialSelect = null; // callback(index)
this.onRender = null; // callback() called after each render (for synced panels)
+ this.onBeforeChange = null; // callback() called before any mutation (for undo/redo)
// Setup event handlers
this.setupMouseHandlers();
@@ -569,6 +570,7 @@ class SpectrogramViewer {
companionOff = { dt: curve.t1 - curve.t0, dv: curve.v1 - curve.v0 };
else if (ptIdx === 3)
companionOff = { dt: curve.t2 - curve.t3, dv: curve.v2 - curve.v3 };
+ if (this.onBeforeChange) this.onBeforeChange();
this.dragState = { pointIndex: ptIdx, companionOff };
canvas.style.cursor = 'grabbing';
e.preventDefault();