Repository navigation
Commit 6aaf3ed
committed
fix(studio): use CSS transform scale instead of zoom for preview stage
CSS zoom is a layout property — changing it triggers ResizeObserver on
descendant elements, which causes scaleIframeToFit to re-run with
getBoundingClientRect values already inflated by the zoom factor. The
iframe ends up scaled too small, leaving visible letterbox as zoom
increases (the reported "canvas border expands inward" bug).
CSS transform scale is visual-only. ResizeObserver never fires on scale
changes, so scaleIframeToFit keeps the scale it computed on initial
mount (based on layout dimensions). The parent transform then magnifies
the player and composition uniformly, so the composition always fills
the player's visual bounds.
Also switches transformOrigin from "0 0" to "50% 50%" so zooming is
centred, which matches the clampPreviewPan formula that already assumes
a centre origin for pan clamping.
Closes #7521 parent 1caeb28 commit 6aaf3ed
1 file changed
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
95 | 94 | | |
96 | 95 | | |
97 | 96 | | |
| |||
276 | 275 | | |
277 | 276 | | |
278 | 277 | | |
279 | | - | |
280 | | - | |
281 | | - | |
| 278 | + | |
| 279 | + | |
282 | 280 | | |
283 | 281 | | |
284 | 282 | | |
| |||
0 commit comments