Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix Alt+click reroute creation on high-DPI displays
- Remove devicePixelRatio scaling from isPointInStroke coordinates
- Coordinates were being double-scaled causing hit detection failures
- Fixes issue #4803 where Alt+click reroute creation failed on high-DPI screens
- Ensures consistent coordinate system between rendering and hit detection
  • Loading branch information
vivekchavan14 committed Aug 7, 2025
commit 7e6e1143978a9a3ba4f1642a8eb91dd1e056763b
3 changes: 1 addition & 2 deletions src/lib/litegraph/src/LGraphCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down