perf: v3.26.155 手势期临时合成层 + 命中层 SVG 不再每帧变形(修拖动画面滞留/掉帧)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 39s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 39s
This commit is contained in:
1 parent
4ce222a4bd
commit
c80dc7e50a
7 files changed
+30
-7
No files matched your search
@@ -417,11 +417,13 @@
|
||||
const s = Number(viewport && viewport.scale) > 0 ? Number(viewport.scale) : 1
|
||||
return 'translate(' + x + ',' + y + ') scale(' + s + ')'
|
||||
}
|
||||
function applyViewportDom (root, canvasSize, x, y, scale, gridOpts) {
|
||||
function applyViewportDom (root, canvasSize, x, y, scale, gridOpts, opts) {
|
||||
if (!root) return
|
||||
const wl = root.querySelector && root.querySelector('.iwb-world')
|
||||
if (wl) wl.style.transform = 'translate(' + x + 'px, ' + y + 'px) scale(' + scale + ')'
|
||||
applyEdgeLayerDom(root, canvasSize, x, y, scale)
|
||||
// v3.26.155:手势期间不写命中层 SVG 的 transform —— 每帧改一个装着上百条 path 的 <g>,
|
||||
// WebKit 会把整层 SVG 重新布局+栅格化;它本来不可见(视觉在 canvas 上),停手后再对齐一次即可。
|
||||
if (!(opts && opts.skipEdgeLayer)) applyEdgeLayerDom(root, canvasSize, x, y, scale)
|
||||
const grid = root.querySelector ? root.querySelector('.iwb-grid') : null
|
||||
if (!grid) return
|
||||
const o = gridOpts || { base: 22, dot: 1.4, color: 'rgba(120,128,140,0.55)', on: true }
|
||||
|
||||
Reference in new issue
Block a user