fix(编辑能力): 修复横向滚动回弹

This commit is contained in:
xiaoqidun committed 2026-10-29 16:37:35 +08:00
1 parent 545b697310
commit 19084bb40b
1 file changed
+8
+8
View File
@@ -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