summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/timeline_editor/index.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/timeline_editor/index.html b/tools/timeline_editor/index.html
index 402c580..4ea93f2 100644
--- a/tools/timeline_editor/index.html
+++ b/tools/timeline_editor/index.html
@@ -851,7 +851,8 @@
dom.waveformContainer.addEventListener('click', async e => {
if (!state.audioBuffer) return;
const rect = dom.waveformContainer.getBoundingClientRect();
- const clickX = e.clientX - rect.left + dom.timelineContent.scrollLeft;
+ const canvasOffset = parseFloat(dom.waveformCanvas.style.left) || 0;
+ const clickX = e.clientX - rect.left - canvasOffset;
const clickBeats = clickX / state.pixelsPerSecond;
const clickTime = beatsToTime(clickBeats);
const wasPlaying = state.isPlaying;