diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-05-15 20:30:43 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-05-15 20:30:43 (GMT) |
commit | 64aee7b4301e720a7420ab8942ef88f72d7a2c99 (patch) | |
tree | 3576cf5cce47d5e4851d9f85b215dcce7ea5c828 /src/gtkext/graph/nodes | |
parent | 7baab38a0e9717110f7b4fb54efeb2d864040ecd (diff) |
Avoided crashes in graph views by filtering middle pending positions.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@537 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext/graph/nodes')
-rw-r--r-- | src/gtkext/graph/nodes/flow.c | 12 |
1 files changed, 11 insertions, 1 deletions
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; |