Fix clientX/Y offset calculation (#248)

This commit is contained in:
Chenlei Hu
2024-07-28 07:50:00 -04:00
committed by GitHub
parent 3e3e909e36
commit 6dbdb9baa6

View File

@@ -2957,7 +2957,7 @@ export class ComfyApp {
const rect = this.canvasContainer.getBoundingClientRect()
const containerOffsets = [rect.left, rect.top]
return _.zip(pos, this.canvas.ds.offset, containerOffsets).map(
([p, o1, o2]) => p / this.canvas.ds.scale - o1 - o2
([p, o1, o2]) => (p - o2) / this.canvas.ds.scale - o1
) as Vector2
}
}