Skip to content

Open source CapCut alternative.

TypeScript

fix(site): snap titles to the visible clip joints

David Le10e8957cb445
diff --git a/site/src/cut/components/Timeline.tsx b/site/src/cut/components/Timeline.tsx
index a482de9c..18b8c0fa 100644
--- a/site/src/cut/components/Timeline.tsx
+++ b/site/src/cut/components/Timeline.tsx
@@ -1667,8 +1667,9 @@ function OverlayClipView({
function textSnapTargets(s: ReturnType<typeof useEditor.getState>, selfId: string): number[] {
const pts = new Set<number>([0]);
for (const sp of getClipSpans(s.clips, s.assets)) {
- pts.add(sp.start);
- pts.add(sp.start + sp.len);
+ // The visible joint: a dissolved pair meets at the overlap midpoint (where
+ // the clip boxes are inset to), a hard cut at the footprint end.
+ pts.add(sp.start + sp.len - sp.transitionOut / 2);
}
pts.add(projectDuration(s));
pts.add(s.currentTime);