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 };