Fix badge position on collapsed nodes (#797)

* Update litegraph (Proper collapsed node handling)

* Add playwright test

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-09-12 17:15:20 +09:00
committed by GitHub
parent fa9a415c62
commit c99ca004b4
6 changed files with 26 additions and 10 deletions

View File

@@ -73,11 +73,8 @@ watch(
inputStyle.value.fontSize = `${fontSize}px`
} else if (target instanceof LGraphNode) {
const node = target
const isCollapsed = node.flags?.collapsed
const [x, y, nodeWidth, nodeHeight] = node.getBounding()
const canvasWidth =
// @ts-expect-error Remove after collapsed_width is exposed in LiteGraph
isCollapsed && node._collapsed_width ? node._collapsed_width : nodeWidth
const [x, y] = node.getBounding()
const canvasWidth = node.width
const canvasHeight = LiteGraph.NODE_TITLE_HEIGHT
const [left, top] = app.canvasPosToClientPos([x, y])