summaryrefslogtreecommitdiff
path: root/tools/timeline_editor/timeline-viewport.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/timeline_editor/timeline-viewport.js')
-rw-r--r--tools/timeline_editor/timeline-viewport.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/timeline_editor/timeline-viewport.js b/tools/timeline_editor/timeline-viewport.js
index 396b648..eeb2582 100644
--- a/tools/timeline_editor/timeline-viewport.js
+++ b/tools/timeline_editor/timeline-viewport.js
@@ -32,6 +32,7 @@ export class ViewportController {
this.dom.propertiesPanel.addEventListener('wheel', e => e.stopPropagation());
document.querySelector('.zoom-controls').addEventListener('wheel', e => e.stopPropagation());
document.querySelector('.stats').addEventListener('wheel', e => e.stopPropagation());
+ document.getElementById('timeMarkers').addEventListener('wheel', e => e.stopPropagation());
// Waveform hover tracking
this.dom.waveformContainer.addEventListener('mouseenter', () => this.showWaveformCursor());
@@ -146,7 +147,7 @@ export class ViewportController {
const mouseX = e.clientX - rect.left;
const scrollLeft = this.dom.timelineContent.scrollLeft;
const timeBeats = (scrollLeft + mouseX - this.TIMELINE_LEFT_PADDING) / this.state.pixelsPerSecond;
- const timeSeconds = timeBeats * 60.0 / this.state.bpm;
+ const timeSeconds = timeBeats * this.state.secondsPerBeat;
// Position cursor
this.dom.waveformCursor.style.left = `${mouseX}px`;
@@ -164,6 +165,6 @@ export class ViewportController {
// Helper
timeToBeats(seconds) {
- return seconds * this.state.bpm / 60.0;
+ return seconds * this.state.beatsPerSecond;
}
}