From 6bbf7d27dfe2fa27b277fee8ca83a09dc23775cb Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Mon, 16 Feb 2026 19:12:06 -0500 Subject: [PATCH] node connection improvement --- lightningbeam-ui/egui_node_graph2/src/editor_ui.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lightningbeam-ui/egui_node_graph2/src/editor_ui.rs b/lightningbeam-ui/egui_node_graph2/src/editor_ui.rs index 6cf8837..60c0f5f 100644 --- a/lightningbeam-ui/egui_node_graph2/src/editor_ui.rs +++ b/lightningbeam-ui/egui_node_graph2/src/editor_ui.rs @@ -912,9 +912,10 @@ where let resp = ui.allocate_rect(port_rect, sense); - // Check if the mouse is within the port's interaction rect + // Check if the mouse is within snap distance of the port center + // Uses circular distance to match snap_to_ports() behavior let close_enough = if let Some(pointer_pos) = ui.ctx().pointer_hover_pos() { - port_rect.contains(pointer_pos) + port_pos.distance(pointer_pos) < DISTANCE_TO_CONNECT * pan_zoom.zoom } else { false };