diff --git a/src/main.ts b/src/main.ts index 7c8bc3d..1145d19 100644 --- a/src/main.ts +++ b/src/main.ts @@ -179,11 +179,13 @@ export default function () { function clampWindowSize (size: { width: number; height: number }) { const b = figma.viewport.bounds const zoom = figma.viewport.zoom || 1 + // Upper bound only — based on the visible viewport. Figma itself enforces its own + // minimum window size, so we no longer clamp a floor here. const maxW = Math.max(320, Math.round(b.width * zoom)) const maxH = Math.max(200, Math.round(b.height * zoom)) return { - width: Math.max(320, Math.min(maxW, Math.round(size.width))), - height: Math.max(200, Math.min(maxH, Math.round(size.height))) + width: Math.min(maxW, Math.round(size.width)), + height: Math.min(maxH, Math.round(size.height)) } }