mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-06 16:10:09 +00:00
Fix reroutes ignore change in radius (#379)
This commit is contained in:
@@ -1048,9 +1048,9 @@ export class LGraph implements LinkNetwork, Serialisable<SerialisableGraph> {
|
||||
*/
|
||||
getRerouteOnPos(x: number, y: number): Reroute | undefined {
|
||||
for (const reroute of this.reroutes.values()) {
|
||||
const pos = reroute.pos
|
||||
const { pos } = reroute
|
||||
|
||||
if (isSortaInsideOctagon(x - pos[0], y - pos[1], 20))
|
||||
if (isSortaInsideOctagon(x - pos[0], y - pos[1], 2 * Reroute.radius))
|
||||
return reroute
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,21 +283,21 @@ export class Reroute implements Positionable, LinkSegment, Serialisable<Serialis
|
||||
ctx.arc(pos[0], pos[1], Reroute.radius, 0, 2 * Math.PI)
|
||||
ctx.fill()
|
||||
|
||||
ctx.lineWidth = 1
|
||||
ctx.lineWidth = Reroute.radius * 0.1
|
||||
ctx.strokeStyle = "rgb(0,0,0,0.5)"
|
||||
ctx.stroke()
|
||||
|
||||
ctx.fillStyle = "#ffffff55"
|
||||
ctx.strokeStyle = "rgb(0,0,0,0.3)"
|
||||
ctx.beginPath()
|
||||
ctx.arc(pos[0], pos[1], 8, 0, 2 * Math.PI)
|
||||
ctx.arc(pos[0], pos[1], Reroute.radius * 0.8, 0, 2 * Math.PI)
|
||||
ctx.fill()
|
||||
ctx.stroke()
|
||||
|
||||
if (this.selected) {
|
||||
ctx.strokeStyle = "#fff"
|
||||
ctx.beginPath()
|
||||
ctx.arc(pos[0], pos[1], 12, 0, 2 * Math.PI)
|
||||
ctx.arc(pos[0], pos[1], Reroute.radius * 1.2, 0, 2 * Math.PI)
|
||||
ctx.stroke()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user