Repository: blitzarx1/egui_graphs (language: rust)

Issue:
Undirected graph drawing issue
When graph is undirected arrows are not shown and instead of them there is blank space. Default `NodeDisplay` should be fixed.
<img width="435" alt="Screenshot 2023-11-28 at 22 04 52" src="https://github.com/blitzarx1/egui_graphs/assets/32969427/621b7667-c763-4856-be63-a5a320bdbc3e">



Discussion / hints:

Fix patch:
diff --git a/src/draw/default_edge.rs b/src/draw/default_edge.rs
index 63e281d..c7ddf24 100644
--- a/src/draw/default_edge.rs
+++ b/src/draw/default_edge.rs
@@ -93,7 +93,10 @@ impl<N: Clone, E: Clone, Ty: EdgeType, Ix: IndexType, D: DisplayNode<N, E, Ty, I
         let tip_end = end_connector_point;
 
         let edge_start = start_connector_point;
-        let edge_end = end_connector_point - self.tip_size * dir;
+        let edge_end = match ctx.is_directed {
+            true => end_connector_point - self.tip_size * dir,
+            false => end_connector_point,
+        };
 
         let stroke_edge = Stroke::new(self.width * ctx.meta.zoom, color);
         let stroke_tip = Stroke::new(0., color);
diff --git a/src/elements/node.rs b/src/elements/node.rs
index bf2e7e7..3b44d5e 100644
--- a/src/elements/node.rs
+++ b/src/elements/node.rs
@@ -4,7 +4,7 @@ use std::marker::PhantomData;
 use egui::Pos2;
 use petgraph::{
     stable_graph::{DefaultIx, IndexType, NodeIndex},
-    EdgeType, Directed,
+    Directed, EdgeType,
 };
 
 use crate::{DefaultNodeShape, DisplayNode};


Test patch: