Skip to content

Commit 1d2aca6

Browse files
committed
fix(shader-transitions): pin cloned scene roots to composition dimensions
1 parent 17db454 commit 1d2aca6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎packages/shader-transitions/src/engineModePageComposite.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,17 @@ export function installPageSideCompositor(options: PageCompositorInstallOptions)
247247
for (const clone of [fromClone, toClone]) {
248248
clone.style.opacity = "1";
249249
clone.style.visibility = "visible";
250+
// A scene root sized only by `position:absolute; inset:0` resolves to
251+
// 0x0 inside the staging canvas's layout subtree (no containing-block
252+
// dimensions there) — the clone then paints nothing and the transition
253+
// textures are blank (wild report: explicit 1080x1920 anchors fixed
254+
// both transitions). Pin the clone to the composition's pixel size;
255+
// scenes that already carry explicit dimensions are unaffected.
256+
clone.style.position = "absolute";
257+
clone.style.left = "0";
258+
clone.style.top = "0";
259+
clone.style.width = `${width}px`;
260+
clone.style.height = `${height}px`;
250261
clone.querySelectorAll<HTMLElement>("[data-start]").forEach((el) => {
251262
el.style.opacity = "1";
252263
el.style.visibility = "visible";

0 commit comments

Comments
 (0)