Increase slot context menu hit box (#777)

Previously, gap between slots was the same height as the slot itself.

Gap is now entirely removed, bringing it inline with the
previously-modified snap and link connection hit boxes.
This commit is contained in:
filtered
2025-03-14 09:30:22 +11:00
committed by GitHub
parent 034692120e
commit 9315a8810e

View File

@@ -1863,7 +1863,7 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
if (inputs) {
for (const [i, input] of inputs.entries()) {
const pos = this.getInputPos(i)
if (isInRectangle(x, y, pos[0] - 10, pos[1] - 5, 20, 10)) {
if (isInRectangle(x, y, pos[0] - 10, pos[1] - 10, 20, 20)) {
return { input, slot: i, link_pos: pos }
}
}
@@ -1872,7 +1872,7 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
if (outputs) {
for (const [i, output] of outputs.entries()) {
const pos = this.getOutputPos(i)
if (isInRectangle(x, y, pos[0] - 10, pos[1] - 5, 20, 10)) {
if (isInRectangle(x, y, pos[0] - 10, pos[1] - 10, 20, 20)) {
return { output, slot: i, link_pos: pos }
}
}