node connection improvement

This commit is contained in:
Skyler Lehmkuhl 2026-02-16 19:12:06 -05:00
parent 2c0d53fb84
commit 6bbf7d27df
1 changed files with 3 additions and 2 deletions

View File

@ -912,9 +912,10 @@ where
let resp = ui.allocate_rect(port_rect, sense); 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() { 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 { } else {
false false
}; };