Double click node title to trigger edit (#655)

* Update litegraph

* Double click edit node title

* Update

* Auto select all

* Update litegraph

* Add playwright test

* Update readme

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-08-27 11:38:39 -04:00
committed by GitHub
parent 6ab92f28db
commit 50b418113c
10 changed files with 218 additions and 6 deletions

View File

@@ -3006,6 +3006,14 @@ export class ComfyApp {
) as Vector2
}
canvasPosToClientPos(pos: Vector2): Vector2 {
const rect = this.canvasContainer.getBoundingClientRect()
const containerOffsets = [rect.left, rect.top]
return _.zip(pos, this.canvas.ds.offset, containerOffsets).map(
([p, o1, o2]) => (p + o1) * this.canvas.ds.scale + o2
) as Vector2
}
getCanvasCenter(): Vector2 {
const dpi = Math.max(window.devicePixelRatio ?? 1, 1)
const [x, y, w, h] = app.canvas.ds.visible_area