feat: drop plugin-side min window size; let Figma enforce its own limit
This commit is contained in:
1 parent
ce20357098
commit
fd0c52342f
1 file changed
+4
-2
+4
-2
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user