release: v3.26.148 Canvas V3 layer 节点
This commit is contained in:
1 parent
e071923d1e
commit
a5d41a85fe
9 files changed
+31
-7
No files matched your search
@@ -93,7 +93,7 @@
|
||||
// 标题
|
||||
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: '生成配置', plugin: '插件' }[n.type] || (String(n.type).indexOf('plugin:') === 0 ? '插件' : '节点')))
|
||||
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)
|
||||
@@ -142,6 +142,20 @@
|
||||
ctx.font = Math.max(10, 12 / scale * 0.9) + 'px -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif'
|
||||
ctx.fillText('选中查看结果', ix + 2, iy + Math.max(14, 16 / scale))
|
||||
}
|
||||
} else if (n.type === 'layer') {
|
||||
// 分层节点:画层列表;选中后由 NodeCard 负责完整图层操作。
|
||||
const layers = (n.data && Array.isArray(n.data.layers)) ? n.data.layers : []
|
||||
ctx.fillStyle = text
|
||||
ctx.font = Math.max(10, 12 / scale * 0.9) + 'px -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif'
|
||||
const lh = Math.max(14, 20 / scale)
|
||||
let yy = iy + Math.max(14, 18 / scale)
|
||||
for (let i = 0; i < Math.min(8, layers.length); i++) {
|
||||
const name = String((layers[i] && layers[i].name) || ('图层 ' + (i + 1)))
|
||||
ctx.fillText(name, ix + 2, yy)
|
||||
yy += lh
|
||||
if (yy > iy + ih) break
|
||||
}
|
||||
if (!layers.length) ctx.fillText('选中查看分层', ix + 2, iy + Math.max(14, 16 / scale))
|
||||
} else {
|
||||
// P2 文本节点:画截断文本,选中后由 NodeCard 负责编辑。
|
||||
ctx.save()
|
||||
|
||||
Reference in new issue
Block a user