release: v3.26.149 Canvas V3 LOD + 1000 节点基线
This commit is contained in:
1 parent
56eb70f794
commit
6ce5f67920
6 files changed
+39
-7
No files matched your search
@@ -83,6 +83,14 @@
|
||||
for (const n of nodes) {
|
||||
if (!n || !isType(n) || sel.indexOf(n.id) >= 0) continue
|
||||
const x = n.x, y = n.y, nw = widthOf(n), nh = heightOf(n)
|
||||
const screenW = nw * scale
|
||||
// LOD:极小节点只画底板,跳标题/文本/图片,避免 7000 节点缩放时做无用绘制。
|
||||
if (screenW < 8) {
|
||||
ctx.fillStyle = bg
|
||||
ctx.fillRect(x, y, nw, nh)
|
||||
continue
|
||||
}
|
||||
const lowDetail = screenW < 40
|
||||
// 卡片
|
||||
ctx.fillStyle = bg
|
||||
roundRect(ctx, x, y, nw, nh, radius)
|
||||
@@ -94,12 +102,15 @@
|
||||
ctx.fillStyle = text
|
||||
ctx.font = '600 ' + Math.max(10, 12 / scale * 0.9) + 'px -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif'
|
||||
const title = String((n.data && (n.data.title || n.data.name)) || ({ ref: '参考图', prompt: '提示词', textout: '文本', combine: '组合', batch: '连接', relay: '中继', gen: '生成配置', layer: '分层', plugin: '插件' }[n.type] || (String(n.type).indexOf('plugin:') === 0 ? '插件' : '节点')))
|
||||
ctx.save()
|
||||
ctx.beginPath(); ctx.rect(x + 10, y, Math.max(0, nw - 20), headH); ctx.clip()
|
||||
ctx.fillText(title, x + 12, y + 21)
|
||||
ctx.restore()
|
||||
if (!lowDetail) {
|
||||
ctx.save()
|
||||
ctx.beginPath(); ctx.rect(x + 10, y, Math.max(0, nw - 20), headH); ctx.clip()
|
||||
ctx.fillText(title, x + 12, y + 21)
|
||||
ctx.restore()
|
||||
}
|
||||
const pad = 10
|
||||
const ix = x + pad, iy = y + headH, iw = Math.max(1, nw - pad * 2), ih = Math.max(1, nh - headH - pad)
|
||||
if (lowDetail) continue
|
||||
if (n.type === 'ref') {
|
||||
// 图片区
|
||||
const raw = n.data && (n.data.data || n.data.url)
|
||||
|
||||
Reference in new issue
Block a user