fix: v3.26.163 松手同帧强制重绘边线(进一步消掉旧连线残留)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m14s

This commit is contained in:
qiqi committed 2026-12-01 14:15:48 +08:00
1 parent 37369d1145
commit 0617eb7b14
5 files changed
+26 -5

No files matched your search

+22 -1
View File
@@ -7405,7 +7405,7 @@ const tbCenterSeed = (type, refs) => {
if (typeof refs.edgeCanvasDraw === 'function') refs.edgeCanvasDraw(vp.x, vp.y, vp.scale)
}
} catch (e3) { /* ignore */ }
}, 140)
}, 60)
}
const applyViewportDom = (x, y, scale) => {
@@ -7442,6 +7442,27 @@ const tbCenterSeed = (type, refs) => {
}
}
// v3.26.163:松手后立刻重绘边线(同帧 + 下一帧各一次)——
// 之前只靠 140ms 定时器 + React 提交,重负载时旧连线会滞留到下一次渲染(体感约 1 秒)。
React.useEffect(() => {
const flush = () => {
const el = canvasEl && canvasEl.el
if (!el || !el.querySelector) return
const cv = el.querySelector('.iwb-edge-canvas')
if (cv) cv.style.transform = ''
const vp = refs.lastViewport || refs.viewportLive || refs.viewport || { x: 0, y: 0, scale: 1 }
try { if (typeof refs.edgeCanvasDraw === 'function') refs.edgeCanvasDraw(vp.x, vp.y, vp.scale) } catch (e) { /* ignore */ }
try { CanvasGeometry.applyEdgeLayerDom(el, canvasSize, vp.x, vp.y, vp.scale) } catch (e2) { /* ignore */ }
}
const onUp = () => { flush(); requestAnimationFrame(flush) }
window.addEventListener('pointerup', onUp, true)
window.addEventListener('pointercancel', onUp, true)
return () => {
window.removeEventListener('pointerup', onUp, true)
window.removeEventListener('pointercancel', onUp, true)
}
}, [canvasSize.w, canvasSize.h])
// LOD 滞回状态:plain 在 <15% 进入、>18% 退出(用 ref 保存,不触发额外渲染)
if (refs.lodPlain === undefined) refs.lodPlain = false
if (!refs.lodPlain && viewport.scale < 0.15) refs.lodPlain = true
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "image-workbench-web",
"private": true,
"version": "3.26.162",
"version": "3.26.163",
"description": "Browser-based node canvas image workbench",
"scripts": {
"build": "node scripts/build.js && node scripts/copy-plugins.js",
+1 -1
View File
@@ -2014,7 +2014,7 @@ dependencies = [
[[package]]
name = "image-workbench"
version = "3.26.161"
version = "3.26.162"
dependencies = [
"arboard",
"base64 0.22.1",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "image-workbench"
version = "3.26.162"
version = "3.26.163"
description = "无限画布 · 生图工作台桌面版"
authors = ["malongan"]
license = ""
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "image-workbench",
"version": "3.26.162",
"version": "3.26.163",
"identifier": "com.malongan.imageworkbench",
"build": {
"frontendDist": "../dist",