fix: resolve preview size issue
This commit is contained in:
+5
-1
@@ -7,7 +7,11 @@ export function updateLivePreview(state) {
|
|||||||
const cw = container.clientWidth;
|
const cw = container.clientWidth;
|
||||||
if (cw <= 0) return;
|
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');
|
const field = $('field');
|
||||||
field.style.width = state.fieldW + 'px';
|
field.style.width = state.fieldW + 'px';
|
||||||
field.style.height = state.fieldH + 'px';
|
field.style.height = state.fieldH + 'px';
|
||||||
|
|||||||
@@ -441,7 +441,9 @@ main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#field {
|
#field {
|
||||||
position: relative;
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
transform-origin: 0 0;
|
transform-origin: 0 0;
|
||||||
background: #0c1018;
|
background: #0c1018;
|
||||||
}
|
}
|
||||||
@@ -502,7 +504,6 @@ body.mode-preview .right-col {
|
|||||||
}
|
}
|
||||||
|
|
||||||
body.mode-preview .left-col {
|
body.mode-preview .left-col {
|
||||||
max-width: 900px;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user