Skip to content

Commit

Permalink
fix: node_size returnes negative (#208)
Browse files Browse the repository at this point in the history
`node_size` func returned negative values which cause panics when
drawing edges
  • Loading branch information
blitzarx1 authored Sep 22, 2024
1 parent aefdc66 commit 988536c
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.
((connector_right.x - connector_left.x) / 2.).abs()
}

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

0 comments on commit 988536c

Please sign in to comment.