Fix preview panel dimensions to account for controls

This commit is contained in:
WOGGER7 2025-07-21 14:32:41 +05:30
parent 35abbefd2e
commit b555d65ea6
1 changed files with 5 additions and 3 deletions

View File

@ -53,9 +53,11 @@ export function PreviewPanel() {
let availableWidth, availableHeight;
if (isExpanded) {
// Use full viewport when expanded
availableWidth = window.innerWidth;
availableHeight = window.innerHeight;
// Use full viewport when expanded, accounting for controls and margin
const controlsHeight = 80; // Approximate height of controls area
const marginSpace = 24; // m-3 = 12px on each side = 24px total
availableWidth = window.innerWidth - marginSpace;
availableHeight = window.innerHeight - controlsHeight - marginSpace;
} else {
container = containerRef.current.getBoundingClientRect();
const computedStyle = getComputedStyle(containerRef.current);