Repository: blitzarx1/egui_graphs (language: rust)

Issue:
node_size causes assert failure when dir is up or down.
PR to fix incoming.

If the direction is up or down, then node_size returns 0 which is bad (causes assert failures in egui font rendering code)

https://github.com/blitzarx1/egui_graphs/blob/71ee2bd5a0cf55edb67262f904babea47c22dd47/src/draw/displays_default/edge.rs#L279


Discussion / hints:

Fix patch:
diff --git a/src/draw/displays_default/edge.rs b/src/draw/displays_default/edge.rs
index 6f8ef19..c7bfec9 100644
--- a/src/draw/displays_default/edge.rs
+++ b/src/draw/displays_default/edge.rs
@@ -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`.


Test patch: