From 8f520cea6c561fdb067a224b552875de0d7d7ef4 Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 15 Feb 2026 15:18:42 +0100 Subject: refactor(timeline-editor): complete variable unit renames in modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - newPixelsPerSecond → newPixelsPerBeat - maxTime → maxTimeBeats (in waveform render) Co-Authored-By: Claude Sonnet 4.5 --- tools/timeline_editor/timeline-playback.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tools/timeline_editor/timeline-playback.js') diff --git a/tools/timeline_editor/timeline-playback.js b/tools/timeline_editor/timeline-playback.js index 5427499..8c84877 100644 --- a/tools/timeline_editor/timeline-playback.js +++ b/tools/timeline_editor/timeline-playback.js @@ -108,19 +108,19 @@ export class PlaybackController { const canvas = this.dom.waveformCanvas; const ctx = canvas.getContext('2d'); - // Calculate maxTime same as timeline - let maxTime = 60; + // Calculate maxTimeBeats same as timeline + let maxTimeBeats = 60; for (const seq of this.state.sequences) { - maxTime = Math.max(maxTime, seq.startTime + this.SEQUENCE_DEFAULT_DURATION); + maxTimeBeats = Math.max(maxTimeBeats, seq.startTime + this.SEQUENCE_DEFAULT_DURATION); for (const effect of seq.effects) { - maxTime = Math.max(maxTime, seq.startTime + effect.endTime); + maxTimeBeats = Math.max(maxTimeBeats, seq.startTime + effect.endTime); } } if (this.state.audioDurationSeconds > 0) { - maxTime = Math.max(maxTime, this.state.audioDurationSeconds * this.state.beatsPerSecond); + maxTimeBeats = Math.max(maxTimeBeats, this.state.audioDurationSeconds * this.state.beatsPerSecond); } - const w = maxTime * this.state.pixelsPerBeat; + const w = maxTimeBeats * this.state.pixelsPerBeat; const h = 80; canvas.width = w; canvas.height = h; @@ -170,7 +170,7 @@ export class PlaybackController { // Beat markers ctx.strokeStyle = 'rgba(255, 255, 255, 0.15)'; ctx.lineWidth = 1; - for (let beat = 0; beat <= maxTime; beat++) { + for (let beat = 0; beat <= maxTimeBeats; beat++) { const x = beat * this.state.pixelsPerBeat; ctx.beginPath(); ctx.moveTo(x, 0); -- cgit v1.2.3