Skip to content

Commit

Permalink
fix size 0 when dir up or down (#212)
Browse files Browse the repository at this point in the history
fixes #211 by calculating distance between connectors correctly.
  • Loading branch information
XertroV authored Sep 23, 2024
1 parent 71ee2bd commit 15d53f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/draw/displays_default/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ fn node_size<N: Clone, E: Clone, Ty: EdgeType, Ix: IndexType, D: DisplayNode<N,
let connector_left = node.display().closest_boundary_point(dir);
let connector_right = node.display().closest_boundary_point(-dir);

((connector_right.x - connector_left.x) / 2.).abs()
((connector_right.to_vec2() - connector_left.to_vec2()) / 2.).length()
}

/// Returns the distance from line segment `a``b` to point `c`.
Expand Down

0 comments on commit 15d53f6

Please sign in to comment.