fix: v3.26.162 手势结束主动重绘边线(修松手后旧连线滞留约 1s)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 10s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 10s
This commit is contained in:
1 parent
538816bd9f
commit
37369d1145
5 files changed
+15
-5
No files matched your search
@@ -7394,12 +7394,22 @@ const tbCenterSeed = (type, refs) => {
|
||||
refs.gestureTimer = setTimeout(() => {
|
||||
refs.gestureTimer = 0
|
||||
try { el.classList.remove('iwb-gesture') } catch (e) { /* ignore */ }
|
||||
const vp = refs.viewportLive || refs.viewport || { x: 0, y: 0, scale: 1 }
|
||||
// v3.26.162:停手后**主动**重绘一次边线(不依赖 React 提交)——
|
||||
// 否则最后一帧的旧连线会留在 canvas 上,直到下一次渲染才被清掉(观感就是滞留约 1 秒)。
|
||||
const vp = refs.lastViewport || refs.viewportLive || refs.viewport || { x: 0, y: 0, scale: 1 }
|
||||
try { CanvasGeometry.applyEdgeLayerDom(el, canvasSize, vp.x, vp.y, vp.scale) } catch (e2) { /* ignore */ }
|
||||
try {
|
||||
const cv = el.querySelector ? el.querySelector('.iwb-edge-canvas') : null
|
||||
if (cv) {
|
||||
cv.style.transform = ''
|
||||
if (typeof refs.edgeCanvasDraw === 'function') refs.edgeCanvasDraw(vp.x, vp.y, vp.scale)
|
||||
}
|
||||
} catch (e3) { /* ignore */ }
|
||||
}, 140)
|
||||
}
|
||||
|
||||
const applyViewportDom = (x, y, scale) => {
|
||||
refs.lastViewport = { x: x, y: y, scale: scale }
|
||||
try { wMarkGesture() } catch (e) { /* ignore */ }
|
||||
CanvasGeometry.applyViewportDom(canvasEl.el, canvasSize, x, y, scale, refs.gridOpts, { skipEdgeLayer: true })
|
||||
// 边线/节点 canvas:手势期间命令式重画,避免等 React
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-workbench-web",
|
||||
"private": true,
|
||||
"version": "3.26.161",
|
||||
"version": "3.26.162",
|
||||
"description": "Browser-based node canvas image workbench",
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js && node scripts/copy-plugins.js",
|
||||
|
||||
Generated
+1
-1
@@ -2014,7 +2014,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "image-workbench"
|
||||
version = "3.26.160"
|
||||
version = "3.26.161"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"base64 0.22.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "image-workbench"
|
||||
version = "3.26.161"
|
||||
version = "3.26.162"
|
||||
description = "无限画布 · 生图工作台桌面版"
|
||||
authors = ["malongan"]
|
||||
license = ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "image-workbench",
|
||||
"version": "3.26.161",
|
||||
"version": "3.26.162",
|
||||
"identifier": "com.malongan.imageworkbench",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
Reference in new issue
Block a user