mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 14:54:12 +00:00
Fix clientX/Y offset calculation (#248)
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user