Files
image-workbench-desktop/src-tauri/tauri.conf.json
T
qiqi 383b28cc77 fix(canvas-webview)!: 恢复画布内网页,修好「一动就白 / 只有某个缩放比例能看」
推翻 v3.25.27 的「下线」判断。用户补充的现象是决定性的:
不动时有内容,移动/缩放节点/缩放画布之后就没了,只有某个缩放区间能看。
这不是平台随机失效,而是我们两个策略的必然结果:

1) 「动就藏」——单帧位移/尺寸变化 > 18px 就判定拖动并隐藏,停 140ms 再显示。
   缩放画布与拖缩放手柄都在阈值之上 ⇒ 一动就藏。
2) 「< 64x48 就隐藏」——画布缩小后节点必然变小 ⇒ 只有某个缩放比例能看见
   (正是用户说的「某一个画布缩放大小时显示」)。

最小 Tauri 工程逐帧截图证明平台是安全的:子 webview 连续 60 帧改尺寸、
1x1 极值、连续移动、移出窗口再移回,全都不白。问题全在调度策略。

改动:
- 取消「动就藏」:移动/拖动/缩放全程可见;只有画布切走、模态遮罩、
  交集 < 2px 三种情况才隐藏
- 取消尺寸门槛:交集 >= 2px 就显示
- 位置+尺寸用一次 set_bounds 推送(替代 set_size + set_position 两条消息,
  两条之间有「新尺寸+旧位置」的中间态,是白屏的另一个来源)
- 仍永不 show()/hide()(macOS 上 hide 后 show 静默失效),隐藏 = 停到窗口外
- 位置随时跟(节流 40ms),尺寸静止 120ms 后再推
- 保留自诊断:Err 原文写进节点 + 重试、15s 加载超时提示、_cwv.log

本机真实应用实测:三个节点(baidu/huaban×2)全部出页面,窗口从 3228x2418
缩到 1180x760 后仍在且正常重排。

版本 3.25.28
2026-11-19 06:44:53 +08:00

55 lines
1.8 KiB
JSON

{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "image-workbench",
"version": "3.25.28",
"identifier": "com.malongan.imageworkbench",
"build": {
"frontendDist": "../dist",
"beforeDevCommand": "npm run build",
"beforeBuildCommand": "npm run lint && npm run build && node scripts/strip-plugins.js"
},
"app": {
"withGlobalTauri": true,
"windows": [
{
"label": "main",
"title": "无限画布",
"width": 1440,
"height": 900,
"minWidth": 1024,
"minHeight": 640,
"resizable": true,
"fullscreen": false,
"center": true,
"dragDropEnabled": false
}
],
"security": {
"csp": "default-src 'self'; script-src 'self' blob:; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https:; font-src 'self' data:; connect-src 'self' ipc: http://ipc.localhost https: blob: data: http://127.0.0.1:30092 http://localhost:30092; object-src 'none'; base-uri 'none'; frame-ancestors 'none'"
}
},
"bundle": {
"active": true,
"targets": "all",
"category": "GraphicsAndDesign",
"shortDescription": "无限画布 · 生图工作台",
"longDescription": "节点式无限画布,本地编排与生成图片,支持系统原生另存为。",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/[email protected]",
"icons/icon.icns",
"icons/icon.ico"
],
"createUpdaterArtifacts": true
},
"plugins": {
"updater": {
"endpoints": [
"https://download.maqiart.eu.org/updates/latest.json"
],
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDE3QUU1N0QwQUM5RjE1RjEKUldUeEZaK3MwRmV1RnhjNVhhSlhaSHkvbVRXNDdscHpOa0s0VHF4NHBBQVJBdDQ0dEVlck5FeEsK"
}
}
}