From 19084bb40b926efe6c97ce7846c4f909042d3887 Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Thu, 29 Oct 2026 16:37:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=BC=96=E8=BE=91=E8=83=BD=E5=8A=9B):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A8=AA=E5=90=91=E6=BB=9A=E5=8A=A8=E5=9B=9E?= =?UTF-8?q?=E5=BC=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/webui/ofdgo_view.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/assets/webui/ofdgo_view.js b/assets/webui/ofdgo_view.js index f1bf175..9f8c295 100644 --- a/assets/webui/ofdgo_view.js +++ b/assets/webui/ofdgo_view.js @@ -292,6 +292,14 @@ export function createPageView(context) { unmountPage(index) { const shell = pageView.pageShell(index); if (!shell) return; + if (context.state.editing && shell.classList.contains("rendered")) { + const bounds = shell.getBoundingClientRect(), viewport = context.el.viewerPanel.getBoundingClientRect(); + const margin = context.state.pageWindow?.overscan ?? 600; + if (bounds.bottom >= viewport.top - margin && bounds.top <= viewport.bottom + margin) { + context.state.selectedPages.add(index); + return; + } + } const selection = document.getSelection(); const range = !selection.isCollapsed && selection.rangeCount ? selection.getRangeAt(0) : null; if (context.canvasEditor.input?.item.index === index || context.canvasEditor.crop?.item.index === index