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
[bugfix] Fix link center dot hit detection when marker is disabled
When linkMarkerShape is set to None, clicks were still being detected on the invisible center dot. This fix adds proper checks to skip hit detection when the center marker is disabled.

Fixes center dot hit detection issue

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
  • Loading branch information
benceruleanlu and claude committed Aug 20, 2025
commit d9460fe37980319dfdbc94bf33f88d83bf0643e5
10 changes: 9 additions & 1 deletion src/lib/litegraph/src/LGraphCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2421,7 +2421,10 @@ export class LGraphCanvas
pointer.onDragEnd = (e) => this.#processDraggedItems(e)
return
}
} else if (isInRectangle(x, y, centre[0] - 4, centre[1] - 4, 8, 8)) {
} else if (
this.linkMarkerShape !== LinkMarkerShape.None &&
isInRectangle(x, y, centre[0] - 4, centre[1] - 4, 8, 8)
) {
this.ctx.lineWidth = lineWidth

pointer.onClick = () => this.showLinkMenu(linkSegment, e)
Expand Down Expand Up @@ -4641,6 +4644,11 @@ export class LGraphCanvas

/** @returns If the pointer is over a link centre marker, the link segment it belongs to. Otherwise, `undefined`. */
#getLinkCentreOnPos(e: CanvasPointerEvent): LinkSegment | undefined {
// Skip hit detection if center markers are disabled
if (this.linkMarkerShape === LinkMarkerShape.None) {
return undefined
}

for (const linkSegment of this.renderedPaths) {
const centre = linkSegment._pos
if (!centre) continue
Expand Down
Loading