fix: clamp trim handle end position to timeline boundary
The right-side trim handle could be dragged past the end of the timeline because clampSpanToBounds did not cap the computed end value at totalMs. This adds Math.min(…, totalMs) so the handle snaps to the timeline edge. Fixes #393
This commit is contained in:
@@ -57,7 +57,7 @@ export default function TimelineWrapper({
|
||||
const duration = Math.min(Math.max(rawDuration, minDuration), totalMs);
|
||||
|
||||
const start = Math.max(0, Math.min(normalizedStart, totalMs - duration));
|
||||
const end = start + duration;
|
||||
const end = Math.min(start + duration, totalMs);
|
||||
|
||||
return { start, end };
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user