Fix: Alt+click reroute creation on high-DPI displays (#4831)

This commit is contained in:
Vivek Chavan
2025-08-09 21:29:19 +05:30
committed by GitHub
parent db452c1e63
commit 16d7436883

View File

@@ -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