mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
feat: ensure elements on main track starts at 0
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
buildEmptyTrack,
|
||||
isMainTrack,
|
||||
validateElementTrackCompatibility,
|
||||
enforceMainTrackStart,
|
||||
} from "@/lib/timeline/track-utils";
|
||||
|
||||
export class MoveElementCommand extends Command {
|
||||
@@ -66,9 +67,16 @@ export class MoveElementCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
const adjustedStartTime = enforceMainTrackStart({
|
||||
tracks: tracksToUpdate,
|
||||
targetTrackId: this.targetTrackId,
|
||||
requestedStartTime: this.newStartTime,
|
||||
excludeElementId: this.elementId,
|
||||
});
|
||||
|
||||
const movedElement: TimelineElement = {
|
||||
...element,
|
||||
startTime: this.newStartTime,
|
||||
startTime: adjustedStartTime,
|
||||
};
|
||||
|
||||
const isSameTrack = this.sourceTrackId === this.targetTrackId;
|
||||
|
||||
Reference in New Issue
Block a user