feat(阅读编辑): 修正双页布局重复留白
build.yaml / build (push) Successful in 50s

This commit is contained in:
xiaoqidun committed 2026-10-19 16:06:02 +08:00
1 parent 010baf3370
commit a29b37ddef
1 file changed
+2 -2
+2 -2
View File
@@ -12094,7 +12094,7 @@ function fitWidth(updateStatus = true) {
function fitWidthScale(page) { function fitWidthScale(page) {
if (state.pageLayout > 1) { if (state.pageLayout > 1) {
const size = pageGroupSize(); const size = pageGroupSize();
return Math.min(4, Math.max(1, el.viewerPanel.clientWidth - pageSpace() * 2 - (state.continuous ? 0 : PAGE_LAYOUT_GAP) - scrollbarWidth()) / (size.width * MM_TO_PX)); return Math.min(4, Math.max(1, el.viewerPanel.offsetWidth - pageSpace() * 2 - (state.continuous ? 0 : PAGE_LAYOUT_GAP) - scrollbarWidth()) / (size.width * MM_TO_PX));
} }
page = pageViewSize(page); page = pageViewSize(page);
const space = pageSpace(); const space = pageSpace();
@@ -12126,7 +12126,7 @@ function fitHeight(updateStatus = true) {
} }
if (state.pageLayout > 1) { if (state.pageLayout > 1) {
const size = pageGroupSize(), space = pageSpace(), gap = state.continuous ? 0 : PAGE_LAYOUT_GAP; const size = pageGroupSize(), space = pageSpace(), gap = state.continuous ? 0 : PAGE_LAYOUT_GAP;
const width = Math.max(1, el.viewerPanel.clientWidth - space * 2 - gap - scrollbarWidth()); const width = Math.max(1, el.viewerPanel.offsetWidth - space * 2 - gap - scrollbarWidth());
const height = Math.max(1, el.viewerPanel.clientHeight - space * 2); const height = Math.max(1, el.viewerPanel.clientHeight - space * 2);
setScale(Math.min(width / (size.width * MM_TO_PX), height / (size.height * MM_TO_PX)), updateStatus, "height"); setScale(Math.min(width / (size.width * MM_TO_PX), height / (size.height * MM_TO_PX)), updateStatus, "height");
if (updateStatus) scrollToPage(state.pageIndex); if (updateStatus) scrollToPage(state.pageIndex);