From b0f0a2c7c59d70c9a1e31cfc48ac98e5c42c90d6 Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Sun, 1 Nov 2026 13:08:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E4=B8=8A=E9=A1=B5=E6=AE=8B=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/webui/ofdgo.css | 2 +- assets/webui/ofdgo_view.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/webui/ofdgo.css b/assets/webui/ofdgo.css index bc237b9..960d467 100644 --- a/assets/webui/ofdgo.css +++ b/assets/webui/ofdgo.css @@ -3594,7 +3594,7 @@ button.outline-link:hover { .svg-host { display: grid; justify-items: center; - gap: var(--fit-gap, var(--fit-space, var(--page-space))); + gap: var(--fit-gap, calc(var(--fit-space, var(--page-space)) + 2px)); width: max-content; margin: 0 auto; } diff --git a/assets/webui/ofdgo_view.js b/assets/webui/ofdgo_view.js index d385820..10ac45d 100644 --- a/assets/webui/ofdgo_view.js +++ b/assets/webui/ofdgo_view.js @@ -1420,7 +1420,7 @@ export function createPageView(context) { scale = Math.min(4, Math.max(1, availableWidth - space * 2 - gap) / layoutWidth); if (mode === "height") scale = Math.min(scale, Math.max(1, availableHeight - space * 2) / height); const blockSpace = context.state.continuous ? 0 : Math.max(space, (availableHeight - height * scale) / 2); - const rowGap = context.state.continuous ? 0 : Math.max(gap, blockSpace > space ? blockSpace + 1 : blockSpace); + const rowGap = context.state.continuous ? 0 : Math.max(gap, blockSpace + 2); const nextVertical = contentHeight * scale + rowGap * (rows - 1) + blockSpace * 2 > availableHeight + 0.5; const nextHorizontal = contentWidth * scale + gap + space * 2 > availableWidth + 0.5; if ((!nextVertical || vertical) && (!nextHorizontal || horizontal)) break; @@ -1557,7 +1557,7 @@ export function createPageView(context) { const base = pageView.pageSpace(); context.el.viewerPanel.classList.toggle("single-page-fits-height", context.state.doc.pageCount === 1 && height <= context.el.viewerPanel.clientHeight - base * 2); const space = context.state.continuous ? 0 : Math.max(base, (context.el.viewerPanel.clientHeight - height) / 2); - const gap = space > base ? space + 1 : space; + const gap = context.state.continuous ? 0 : space + 2; context.el.pageFrame.style.setProperty("--fit-space", `${space}px`); context.el.pageFrame.style.setProperty("--fit-gap", `${gap}px`); },