Skip to content

Commit b92fe1d

Browse files
committed
perf(core): name the clip end instead of commenting it
1 parent 40dbba4 commit b92fe1d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/core/src/runtime/init.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4427,12 +4427,14 @@ export function initSandboxRuntimeModular(): void {
44274427
if (!node) continue;
44284428
const start = resolveStartForElement(node, 0);
44294429
if (!Number.isFinite(start)) continue;
4430-
// A scene is hidden after its clip, so a longer animation rests at the clip's end.
4431-
const hostTime = Math.min(timeSeconds, start + (resolveDurationForElement(node) ?? Infinity));
4430+
const hiddenFrom = start + (resolveDurationForElement(node) ?? Infinity);
44324431
const timelineDuration = getTimelineDurationSeconds(timeline);
44334432
const sourceTime =
44344433
readElementPlaybackStart(node) +
4435-
sourceTimeAt(readElementRateSpec(node), Math.max(0, hostTime - start));
4434+
sourceTimeAt(
4435+
readElementRateSpec(node),
4436+
Math.max(0, Math.min(timeSeconds, hiddenFrom) - start),
4437+
);
44364438
const localTime = Math.max(
44374439
0,
44384440
timelineDuration != null && timelineDuration > 0

0 commit comments

Comments
 (0)