mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 01:27:26 +08:00
fix(编辑能力): 修复横向滚动回弹
This commit is contained in:
1 parent
545b697310
commit
19084bb40b
1 file changed
+8
@@ -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
|
||||
|
||||
Reference in new issue
Block a user