mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
fix: model editor time as wasm MediaTime ticks end-to-end
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { SceneTracks, TimelineElement, VideoTrack } from "@/timeline";
|
||||
import { type MediaTime, ZERO_MEDIA_TIME } from "@/wasm";
|
||||
|
||||
export const MAIN_TRACK_NAME = "Main Track";
|
||||
|
||||
@@ -31,9 +32,9 @@ export function enforceMainTrackStart({
|
||||
}: {
|
||||
tracks: SceneTracks;
|
||||
targetTrackId: string;
|
||||
requestedStartTime: number;
|
||||
requestedStartTime: MediaTime;
|
||||
excludeElementId?: string;
|
||||
}): number {
|
||||
}): MediaTime {
|
||||
if (tracks.main.id !== targetTrackId) {
|
||||
return requestedStartTime;
|
||||
}
|
||||
@@ -43,11 +44,11 @@ export function enforceMainTrackStart({
|
||||
excludeElementId,
|
||||
});
|
||||
if (!earliestElement) {
|
||||
return 0;
|
||||
return ZERO_MEDIA_TIME;
|
||||
}
|
||||
|
||||
if (requestedStartTime <= earliestElement.startTime) {
|
||||
return 0;
|
||||
return ZERO_MEDIA_TIME;
|
||||
}
|
||||
|
||||
return requestedStartTime;
|
||||
|
||||
Reference in New Issue
Block a user