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 | |
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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/gtkext/graph/nodes/flow.c | 12 |
2 files changed, 16 insertions, 1 deletions
@@ -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; |