diff --git a/src/main.ts b/src/main.ts index eb6be18..c236ae5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -31,6 +31,9 @@ export default function () { // - Центр: размер = 50% viewport (по ширине и высоте), центрируется (one-shot, не удерживает) // Возвращает размер (экранные px) и позицию (canvas-space, прижатую к нужному краю). const DEFAULT_DOCK_EDGE = 320 + // Bottom inset (screen px) kept free when side-docked (left/right), so the Figma + // bottom panel/toolbar stays visible instead of being covered by the plugin window. + const DOCK_SIDE_BOTTOM_INSET = 80 let dockEdgeSize = DEFAULT_DOCK_EDGE // редактируемая фикс-сторона для edge-позиций (320 по умолч.) // computeDock считает целевой размер+позицию для док-позиции. // canonical=true — НАЖАТИЕ кнопки дока: задаём канонический размер @@ -51,7 +54,8 @@ export default function () { let targetH = currentHeight if (isLeftRight) { targetW = dockEdgeSize - targetH = canonical ? maxH : Math.min(currentHeight, maxH) + // Leave room at the bottom for the Figma panel/toolbar. + targetH = canonical ? Math.max(200, maxH - DOCK_SIDE_BOTTOM_INSET) : Math.min(currentHeight, maxH - DOCK_SIDE_BOTTOM_INSET) } else if (isTopBottom) { targetW = canonical ? maxW : Math.min(currentWidth, maxW) targetH = dockEdgeSize