fix(studio): use host composition dimensions for all added blocks

Blocks were using their own native dimensions (e.g. 1920x1080) instead
of the host composition dimensions (e.g. 1280x720), causing them to
overflow the viewport and break the layout. The block's iframe scales
its content to fit the container, so using host dimensions is correct.
This commit is contained in:
Miguel Ángel
2026-05-21 18:28:17 -04:00
parent 34a4ad2ed3
commit 997e3948e4
+2 -6
View File
@@ -144,12 +144,8 @@ export async function addBlockToProject(
const zIndex = getMaxZIndexFromIframe(opts.previewIframe ?? null) + 1;
const width = isBlock
? (block as { dimensions: { width: number } }).dimensions.width
: hostDims.width;
const height = isBlock
? (block as { dimensions: { height: number } }).dimensions.height
: hostDims.height;
const width = hostDims.width;
const height = hostDims.height;
const left = visualPosition ? Math.round(visualPosition.left) : 0;
const top = visualPosition ? Math.round(visualPosition.top) : 0;