fix: clip section sub-track content to section bounds
When section duration is resized shorter, sub-track clips and MIDI notes were still drawn outside the section's visual rectangle. Added ctx.save/clip/restore around sub-track rendering.
This commit is contained in:
@@ -712,6 +712,10 @@ const WaveformLane = ({
|
||||
const subTrackCount = Math.min(subTracks.length, 4);
|
||||
const subTrackHeight = (height - 20) / Math.max(1, subTrackCount);
|
||||
const subColors = ['#fbbf24', '#a78bfa', '#ec4899', '#10b981'];
|
||||
ctx.save();
|
||||
ctx.beginPath();
|
||||
ctx.rect(secStartLocal, 2, secWidth, height - 4);
|
||||
ctx.clip();
|
||||
for (let stIdx = 0; stIdx < subTrackCount; stIdx++) {
|
||||
const sub = subTracks[stIdx];
|
||||
if (!sub) continue;
|
||||
@@ -767,6 +771,7 @@ const WaveformLane = ({
|
||||
});
|
||||
});
|
||||
}
|
||||
ctx.restore();
|
||||
});
|
||||
|
||||
// Draw MIDI items
|
||||
|
||||
Reference in New Issue
Block a user