From 2d4dba3f198079d78710e407d7fd9daf84e405ab Mon Sep 17 00:00:00 2001 From: Comfy Org PR Bot Date: Sun, 10 Aug 2025 01:24:31 +0800 Subject: [PATCH] [backport 1.25] Fix: Alt+click reroute creation on high-DPI displays (#4862) Co-authored-by: Vivek Chavan <111511821+vivekchavan14@users.noreply.github.com> --- src/lib/litegraph/src/LGraphCanvas.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/litegraph/src/LGraphCanvas.ts b/src/lib/litegraph/src/LGraphCanvas.ts index cbb644cbf..c8ec9f379 100644 --- a/src/lib/litegraph/src/LGraphCanvas.ts +++ b/src/lib/litegraph/src/LGraphCanvas.ts @@ -2384,7 +2384,6 @@ export class LGraphCanvas // Set the width of the line for isPointInStroke checks const { lineWidth } = this.ctx this.ctx.lineWidth = this.connections_width + 7 - const dpi = window?.devicePixelRatio || 1 for (const linkSegment of this.renderedPaths) { const centre = linkSegment._pos @@ -2394,7 +2393,7 @@ export class LGraphCanvas if ( (e.shiftKey || e.altKey) && linkSegment.path && - this.ctx.isPointInStroke(linkSegment.path, x * dpi, y * dpi) + this.ctx.isPointInStroke(linkSegment.path, x, y) ) { this.ctx.lineWidth = lineWidth