Let composition items overlap and show where their video lies (#417)
Trying the tab turned up six things to fix. Items of a track could not overlap, so a drag stalled as soon as the pointer reached another item. An item's ends gave no hint they could be dragged, a trimmed video showed nowhere, clip names were hard to read and vanished when picked, and the track menu did not match the song tab. - Items of a track may overlap and nothing is cut or pushed aside. The later one lies in front, in the picture and on the timeline. The overlap is shaded and a line marks the covered end. - Edges win over bodies when hit, so the covered end of the lower item can still be dragged. Hovering an edge lights it up and shows the ew-resize cursor, as in the song tab. - A clip in the overlap plays on both items. Clips themselves still do not overlap; a moved clip now runs up to its neighbour instead of stopping short. - Fit to media and a new video no longer cap the length at the next item, which only made sense while overlaps were forbidden. - The left edge can be trimmed past the start of the video. The offset goes negative and the sprite shows the first picture until the video begins. - Video marks: a corner triangle where the item cuts into its video, a line with a triangle like the song loop where the video starts or ends inside the item. Edges snap to the video's ends within 6 px. - Clip names sit in their own layer above the bars, in text colour. - The track menu matches the song tab: add above or below, move up or down, delete. It opens on the head and on an empty spot of the track. The Remove track button left the inspector. Tests: - Unit composition and composition-edit: 67 green, several new or rewritten. Bending three spots in the rules turned their tests red. - e2e 69: ALL PASSED, 12 checks. 69b and 69c now drop the second item over the first and drag the covered end past it. Without edges winning the hit, 69c fails with hover: null. - Gate on melektaus-atx: CHECK EXIT 0, 302 files, 4672 tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4f0272638e
commit
c4650e43f0
10 files changed
+559
-227
No files matched your search
@@ -3,8 +3,13 @@
|
||||
* are written whole once the pointer lets go. An item comes and goes together with its object.
|
||||
*/
|
||||
import type { CompositionAsset, CompositionClip, CompositionItem, CompositionTrack } from '../model/Asset';
|
||||
import { heldCompositionClips, heldCompositionItems, heldCompositionTracks } from '../model/composition';
|
||||
import { mediaKey, refittedLength } from '../model/compositionEdit';
|
||||
import {
|
||||
fittedLength,
|
||||
heldCompositionClips,
|
||||
heldCompositionItems,
|
||||
heldCompositionTracks,
|
||||
} from '../model/composition';
|
||||
import { mediaKey } from '../model/compositionEdit';
|
||||
import type { Project } from '../model/Project';
|
||||
import type { Command } from './Command';
|
||||
import { oneStep } from './CompoundCommand';
|
||||
@@ -106,7 +111,7 @@ export function removeCompositionTrack(project: Project, assetId: string, trackI
|
||||
clips: comp.clips.filter((c) => !clips.includes(c.id)),
|
||||
});
|
||||
return oneStep(
|
||||
'Remove track',
|
||||
'Delete track',
|
||||
objects.length > 0 ? [new RemoveSceneObjectsCommand(assetId, objects), set] : [set],
|
||||
);
|
||||
}
|
||||
@@ -162,7 +167,7 @@ function refitsAfter(project: Project, before: ReadonlyMap<string, string>): Ref
|
||||
for (const item of comp.items) {
|
||||
const was = before.get(`${comp.id}/${item.id}`);
|
||||
if (!item.fitMedia || was === undefined || was === mediaKey(project, comp, item)) continue;
|
||||
const to = refittedLength(project, comp, item);
|
||||
const to = fittedLength(project, comp, item);
|
||||
if (to !== item.length) refits.push({ assetId: comp.id, itemId: item.id, from: item.length, to });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user