From 96a8997482acb3fbe8c258b6bc4b90fe52d21bd1 Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Thu, 15 Oct 2026 10:13:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=89=8D=E7=AB=AF=E7=95=8C=E9=9D=A2):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=9E=E7=BB=AD=E9=80=82=E5=AE=BD=E6=A8=AA?= =?UTF-8?q?=E5=90=91=E6=BB=9A=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/webui/ofdgo.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/assets/webui/ofdgo.js b/assets/webui/ofdgo.js index 5201618..6401a94 100644 --- a/assets/webui/ofdgo.js +++ b/assets/webui/ofdgo.js @@ -10593,7 +10593,8 @@ function fitWidthScale(page) { page = pageViewSize(page); const space = pageSpace(); const width = Math.max(1, page.width * MM_TO_PX); - let available = Math.max(1, el.viewerPanel.clientWidth - space * 2); + const frameWidth = Number.parseFloat(getComputedStyle(el.pageFrame).width) || el.viewerPanel.clientWidth; + let available = Math.max(1, frameWidth - space * 2); if (!viewerHasVerticalScrollbar()) { const limit = Math.max(1, el.viewerPanel.clientHeight - space * 2); let height = Math.max(1, page.height * MM_TO_PX) * (available / width); @@ -10740,14 +10741,16 @@ function viewerHasVerticalScrollbar() { function scrollbarWidth() { const probe = document.createElement("div"); + const content = document.createElement("div"); probe.style.position = "absolute"; probe.style.width = "100px"; probe.style.height = "100px"; probe.style.overflow = "scroll"; probe.style.scrollbarWidth = getComputedStyle(el.viewerPanel).scrollbarWidth; probe.style.left = "-9999px"; + probe.append(content); document.body.append(probe); - const width = probe.offsetWidth - probe.clientWidth; + const width = 100 - Number.parseFloat(getComputedStyle(content).width); probe.remove(); return width; }