Fix node title editor's width when node is collapsed (#671)

* Fix node title editor's width when node is collapsed

* nit
This commit is contained in:
Chenlei Hu
2024-08-28 16:35:01 -04:00
committed by GitHub
parent fb5bb57b0d
commit b25c5259bd

View File

@@ -54,9 +54,12 @@ const extension: ComfyExtension = {
editedTitle.value = this.title
showInput.value = true
const isCollapsed = node.flags?.collapsed
const [x1, y1, x2, y2] = this.getBounding()
const [nodeWidth, nodeHeight] = this.size
const canvasWidth = nodeWidth
const canvasWidth =
// @ts-expect-error Remove after collapsed_width is exposed in LiteGraph
isCollapsed && node._collapsed_width ? node._collapsed_width : nodeWidth
const canvasHeight = LiteGraph.NODE_TITLE_HEIGHT
const [left, top] = app.canvasPosToClientPos([x1, y1])