fix: sync PADDING_LEFT = barDuration in both WaveformLane and TempoTrackLane
This commit is contained in:
@@ -440,7 +440,7 @@ const WaveformLane = ({
|
|||||||
ctx.lineWidth = 1;
|
ctx.lineWidth = 1;
|
||||||
const beatDuration = (60.0 / (parseFloat(bpm) || 120));
|
const beatDuration = (60.0 / (parseFloat(bpm) || 120));
|
||||||
const barDuration = beatDuration * 4;
|
const barDuration = beatDuration * 4;
|
||||||
const PADDING_LEFT = beatDuration; // 1-beat margin on left
|
const PADDING_LEFT = barDuration; // 1-bar margin on left
|
||||||
const tStart = scrollLeftVal / zoom - PADDING_LEFT;
|
const tStart = scrollLeftVal / zoom - PADDING_LEFT;
|
||||||
const tEnd = (scrollLeftVal + drawWidth) / zoom;
|
const tEnd = (scrollLeftVal + drawWidth) / zoom;
|
||||||
let gridSpacing = 1.0;
|
let gridSpacing = 1.0;
|
||||||
@@ -1218,7 +1218,7 @@ const TempoTrackLane = ({
|
|||||||
ctx.fillRect(0, 0, drawWidth, height);
|
ctx.fillRect(0, 0, drawWidth, height);
|
||||||
const beatDuration = 60 / bpm;
|
const beatDuration = 60 / bpm;
|
||||||
const barDuration = beatDuration * 4;
|
const barDuration = beatDuration * 4;
|
||||||
const PADDING_LEFT = 2; // seconds of empty space on left edge
|
const PADDING_LEFT = barDuration; // 1-bar margin on left
|
||||||
const tStart = scrollLeftVal / zoom - PADDING_LEFT;
|
const tStart = scrollLeftVal / zoom - PADDING_LEFT;
|
||||||
const tEnd = (scrollLeftVal + drawWidth) / zoom;
|
const tEnd = (scrollLeftVal + drawWidth) / zoom;
|
||||||
const firstBeat = Math.floor(tStart / beatDuration) * beatDuration;
|
const firstBeat = Math.floor(tStart / beatDuration) * beatDuration;
|
||||||
|
|||||||
Reference in New Issue
Block a user