mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-24 00:34:09 +00:00
Use device scaling for drag-from-link checks (#334)
This commit is contained in:
@@ -2143,6 +2143,7 @@ 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
|
||||
@@ -2152,7 +2153,7 @@ export class LGraphCanvas {
|
||||
if (
|
||||
(e.shiftKey || e.altKey) &&
|
||||
linkSegment.path &&
|
||||
this.ctx.isPointInStroke(linkSegment.path, x, y)
|
||||
this.ctx.isPointInStroke(linkSegment.path, x * dpi, y * dpi)
|
||||
) {
|
||||
if (e.shiftKey && !e.altKey) {
|
||||
const slot = linkSegment.origin_slot
|
||||
|
||||
Reference in New Issue
Block a user