From c771bf8bb988d712fb9390b97f3d524c4b0f75b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Murat=20=C3=87elik?= Date: Thu, 9 Apr 2026 02:02:30 +0300 Subject: [PATCH] fix: clamp trim handle end position to timeline boundary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/components/video-editor/timeline/TimelineWrapper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/video-editor/timeline/TimelineWrapper.tsx b/src/components/video-editor/timeline/TimelineWrapper.tsx index 3616f1838..4c668f0b9 100644 --- a/src/components/video-editor/timeline/TimelineWrapper.tsx +++ b/src/components/video-editor/timeline/TimelineWrapper.tsx @@ -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 }; },