summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/gtkext/graph/nodes/flow.c12
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 046a4f2..c269fa0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+15-05-15 Cyrille Bagard <nocbos@gmail.com>
+
+ * src/gtkext/graph/nodes/flow.c:
+ Avoid crashes in graph views by filtering middle pending positions.
+
15-05-14 Cyrille Bagard <nocbos@gmail.com>
* src/glibext/gcodebuffer.c:
diff --git a/src/gtkext/graph/nodes/flow.c b/src/gtkext/graph/nodes/flow.c
index 2f822bd..343f916 100644
--- a/src/gtkext/graph/nodes/flow.c
+++ b/src/gtkext/graph/nodes/flow.c
@@ -385,7 +385,17 @@ static void g_flow_node_prepare_x_line(GFlowNode *node, GGraphNode *nodes)
pos.left_node = G_GRAPH_NODE(target_a);
pos.right_node = G_GRAPH_NODE(target_b);
- g_graph_node_set_pending_position(base, PPF_MIDDLE_OF, pos);
+ /**
+ * Un pré-condition pour pouvoir s'aligner est que les noeuds
+ * de références soient traités au préalables pour les positions.
+ * Sinon les assert() coincent dans g_virtual_node_apply_x_line().
+ */
+
+ if (g_graph_node_find_container_at_same_level(nodes, base, pos.left_node) != NULL
+ && g_graph_node_find_container_at_same_level(nodes, base, pos.right_node) != NULL)
+ {
+ g_graph_node_set_pending_position(base, PPF_MIDDLE_OF, pos);
+ }
break;