diff --git a/src/components/custom/ISVVideoWallDialog.vue b/src/components/custom/ISVVideoWallDialog.vue index 4f70327..3f8c3b2 100644 --- a/src/components/custom/ISVVideoWallDialog.vue +++ b/src/components/custom/ISVVideoWallDialog.vue @@ -320,10 +320,13 @@ export default defineComponent({ return result; }; - const refreshPreiewGridWH = () => { + const refreshPreviewGridWH = () => { if (preview_grid.value) { - const max_height = window.innerHeight * 0.49; // items-center justify-center - const max_width = preview_grid.value.clientWidth * 0.95; + let max_height = window.innerHeight * 0.49; // items-center justify-center + let max_width = preview_grid.value.clientWidth * 0.95; + max_width = (max_width - preview_cols.value) & ~preview_cols.value; + max_height = (max_height - preview_rows.value) & ~preview_rows.value; + let cell_width = 0; let cell_height = 0; if (screen_mode.value == 0) { @@ -336,16 +339,16 @@ export default defineComponent({ } else { cell_height = max_height / preview_rows.value; if (preview_cols.value == 1 && preview_rows.value == 4) { - cell_width = (cell_height * 18) / 16; + cell_width = (cell_height * 16) / 16; } else { - cell_width = (cell_height * 13) / 16; + cell_width = (cell_height * 12) / 16; } if (cell_width * preview_cols.value > max_width) { cell_width = max_width / preview_cols.value; if (preview_cols.value == 1 && preview_rows.value == 4) { - cell_height = (cell_width * 16) / 18; + cell_height = (cell_width * 16) / 16; } else { - cell_height = (cell_width * 16) / 13; + cell_height = (cell_width * 16) / 12; } } } @@ -363,7 +366,7 @@ export default defineComponent({ preview_rows.value = result.rows; preview_rotation.value = result.rotation; - refreshPreiewGridWH(); + refreshPreviewGridWH(); } ); @@ -374,13 +377,13 @@ export default defineComponent({ const result = parseSpliceMode(splice_mode.value); splice_mode.value = result.rows + "x" + result.cols; } - refreshPreiewGridWH(); + refreshPreviewGridWH(); } ); EventBus.getInstance().on( EventNamesDefine.WindowResize, - refreshPreiewGridWH + refreshPreviewGridWH ); return { @@ -463,7 +466,7 @@ export default defineComponent({ } nextTick(() => { - refreshPreiewGridWH(); + refreshPreviewGridWH(); }); show_dialog.value = true; },