From dc8b1f59faf2320d535151703ce68dd3e4bbc878 Mon Sep 17 00:00:00 2001 From: 3dtours Date: Sat, 25 Jul 2026 09:37:57 +0700 Subject: [PATCH] fix: revert TempoTrackLane PADDING_LEFT to 2s, remove DOM scrollLeft hack --- app/static/js/app.jsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/static/js/app.jsx b/app/static/js/app.jsx index 8c689da..acc4eee 100644 --- a/app/static/js/app.jsx +++ b/app/static/js/app.jsx @@ -1206,13 +1206,7 @@ const TempoTrackLane = ({ if (!canvas) return; const ctx = canvas.getContext('2d'); const dpr = window.devicePixelRatio || 1; - let el = canvas.parentElement; - while (el) { - const ox = getComputedStyle(el).overflowX; - if (ox === 'auto' || ox === 'scroll') break; - el = el.parentElement; - } - const scrollLeftVal = el ? el.scrollLeft : (scrollLeft || 0); + const scrollLeftVal = scrollLeft || 0; const height = canvas.parentElement ? canvas.parentElement.clientHeight : 40; canvas.width = Math.min(Math.round(drawWidth * dpr), 32768); canvas.height = Math.min(Math.round(height * dpr), 32768); @@ -1224,7 +1218,7 @@ const TempoTrackLane = ({ ctx.fillRect(0, 0, drawWidth, height); const beatDuration = 60 / bpm; const barDuration = beatDuration * 4; - const PADDING_LEFT = beatDuration; // 1-beat margin on left + const PADDING_LEFT = 2; // seconds of empty space on left edge const tStart = scrollLeftVal / zoom - PADDING_LEFT; const tEnd = (scrollLeftVal + drawWidth) / zoom; const firstBeat = Math.floor(tStart / beatDuration) * beatDuration;