diff options
Diffstat (limited to 'src/gtkext/graph/cluster.c')
-rw-r--r-- | src/gtkext/graph/cluster.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/gtkext/graph/cluster.c b/src/gtkext/graph/cluster.c index c4deeaa..765bbac 100644 --- a/src/gtkext/graph/cluster.c +++ b/src/gtkext/graph/cluster.c @@ -460,6 +460,8 @@ static gint compute_leaving_link_position(const leaving_link_t *link) static incoming_link_t *create_incoming_link(GGraphCluster *owner, InstructionLinkType type, leaving_link_t *other) { incoming_link_t *result; /* Structure à retourner */ + GCodeBlock *src; /* Bloc d'origine du lien */ + GCodeBlock *dst; /* Bloc de destination du lien */ result = malloc(sizeof(incoming_link_t)); @@ -467,14 +469,23 @@ static incoming_link_t *create_incoming_link(GGraphCluster *owner, InstructionLi result->type = type; + src = other->owner->block; + dst = owner->block; + if (type == ILT_JUMP_IF_TRUE) - result->edge = g_graph_edge_new_true(&other->start[0], &other->start[1], &result->end[0], &result->end[1]); + result->edge = g_graph_edge_new_true(src, dst, + &other->start[0], &other->start[1], + &result->end[0], &result->end[1]); else if (type == ILT_JUMP_IF_FALSE) - result->edge = g_graph_edge_new_false(&other->start[0], &other->start[1], &result->end[0], &result->end[1]); + result->edge = g_graph_edge_new_false(src, dst, + &other->start[0], &other->start[1], + &result->end[0], &result->end[1]); else - result->edge = g_graph_edge_new(&other->start[0], &other->start[1], &result->end[0], &result->end[1]); + result->edge = g_graph_edge_new(src, dst, + &other->start[0], &other->start[1], + &result->end[0], &result->end[1]); result->other = other; @@ -499,6 +510,8 @@ static incoming_link_t *create_incoming_link(GGraphCluster *owner, InstructionLi static incoming_link_t *create_incoming_loop_link(GGraphCluster *owner, const GdkPoint *midpts, leaving_link_t *other) { incoming_link_t *result; /* Structure à retourner */ + GCodeBlock *src; /* Bloc d'origine du lien */ + GCodeBlock *dst; /* Bloc de destination du lien */ result = malloc(sizeof(incoming_link_t)); @@ -506,7 +519,11 @@ static incoming_link_t *create_incoming_loop_link(GGraphCluster *owner, const Gd result->type = ILT_LOOP; - result->edge = g_graph_edge_new_loop(&other->start[0], &other->start[1], + src = other->owner->block; + dst = owner->block; + + result->edge = g_graph_edge_new_loop(src, dst, + &other->start[0], &other->start[1], &midpts[0], &midpts[1], &result->end[0], &result->end[1]); |