diff --git a/app.js b/app.js index 94c5184..274b90b 100644 --- a/app.js +++ b/app.js @@ -7418,7 +7418,10 @@ const tbCenterSeed = (type, refs) => { } try { if (typeof refs.nodeCanvasDraw === 'function') refs.nodeCanvasDraw(x, y, scale) } catch (e) { /* ignore */ } // v3.26.156:平移窗口每跨 1/2 屏更新一次(此时才触发一次 React 渲染,代价可控) - if (!refs.pan || panMountAll) { refs.panCullAt = null } else { + if (!refs.pan || panMountAll) { + refs.panCullAt = null + if (refs.panKeep && refs.panKeep.size) refs.panKeep.clear() + } else { const at = refs.panCullAt const halfW = Math.max(220, (canvasSize.w || 800) * 0.34) const halfH = Math.max(160, (canvasSize.h || 600) * 0.34) @@ -7563,7 +7566,12 @@ const tbCenterSeed = (type, refs) => { return CanvasGeometry.cullRectsOf(canvasSize, navView, extra) }, [canvasSize.w, canvasSize.h, navView.x, navView.y, navView.scale, panCull, panMountAll]) const nodeVisible = (n) => CanvasGeometry.nodeVisibleIn(n, cullRects, { drag: refs.drag, resize: refs.resize, sel: sel, pan: !!refs.pan, mountAll: panMountAll, widthOf: nodeWidth, heightOf: hOf }) - const visibleIds = new Set(nodes.filter(nodeVisible).map((n) => n.id)) + // v3.26.161:平移期间「挂过就不卸」——只在手势中不断扩张挂载集合,松手后才按视口回收。 + // 之前即便边距加大,窗口一跳仍会有节点换挂(图片重新解码),视觉上就是节点突然出现。 + if (!refs.pan && refs.panKeep && refs.panKeep.size) refs.panKeep.clear() + const panKeep = (refs.pan && !panMountAll) ? (refs.panKeep || (refs.panKeep = new Set())) : null + const visibleIds = new Set(nodes.filter((n) => nodeVisible(n) || (panKeep && panKeep.has(n.id))).map((n) => n.id)) + if (panKeep) { for (const id of visibleIds) panKeep.add(id) } try { wSetScaleNow(viewport.scale) } catch (e) { /* ignore */ } // 进程内存(v3.25.74):状态栏显示,便于对比优化前后的内存占用(4s 轮询,窗口隐藏时不拉) diff --git a/package.json b/package.json index d2f7afe..a69dabf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "image-workbench-web", "private": true, - "version": "3.26.160", + "version": "3.26.161", "description": "Browser-based node canvas image workbench", "scripts": { "build": "node scripts/build.js && node scripts/copy-plugins.js", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index f70659b..18c3482 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "image-workbench" -version = "3.26.160" +version = "3.26.161" description = "无限画布 · 生图工作台桌面版" authors = ["malongan"] license = "" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 21879e1..9472f1d 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "image-workbench", - "version": "3.26.160", + "version": "3.26.161", "identifier": "com.malongan.imageworkbench", "build": { "frontendDist": "../dist",