fix: resolve preview size issue

This commit is contained in:
2026-06-23 22:54:20 +05:00
parent 56f01d412e
commit 0b05981b49
2 changed files with 8 additions and 3 deletions
+5 -1
View File
@@ -7,7 +7,11 @@ export function updateLivePreview(state) {
const cw = container.clientWidth;
if (cw <= 0) return;
const scale = cw / state.fieldW;
const maxH = window.innerHeight - 140;
const scaleW = cw / state.fieldW;
const scaleH = maxH / state.fieldH;
const scale = Math.min(scaleW, scaleH);
const field = $('field');
field.style.width = state.fieldW + 'px';
field.style.height = state.fieldH + 'px';