diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-05-12 18:55:55 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-05-12 18:55:55 (GMT) |
commit | 4605b4ac4a04bb11bdf91d77e248656702774bde (patch) | |
tree | 4987c19b0f739ef7cb89ac80068233d6fb037819 /src/gtkext/graph/node.c | |
parent | 46bcc7f122245f22772fd3e38d16e6afa7bd5881 (diff) |
Ensured parent nodes are centered on their children when expected.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@534 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext/graph/node.c')
-rw-r--r-- | src/gtkext/graph/node.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gtkext/graph/node.c b/src/gtkext/graph/node.c index 0210aa3..08dd970 100644 --- a/src/gtkext/graph/node.c +++ b/src/gtkext/graph/node.c @@ -232,22 +232,22 @@ void g_graph_node_apply_position(GGraphNode *node) switch (node->pending_flag) { case PPF_DIRECT_X: - assert(g_graph_node_has_x_position(node->pending_rel)); - g_graph_node_get_position(node->pending_rel, &x_pos, NULL); + assert(g_graph_node_has_x_position(node->pending_pos.relative_ref)); + g_graph_node_get_position(node->pending_pos.relative_ref, &x_pos, NULL); x_pos += node->pending_pos.direct_x; g_graph_node_set_x_position(node, x_pos); break; case PPF_LEFT_MARGIN: - assert(g_graph_node_has_x_position(node->pending_rel)); - g_graph_node_get_position(node->pending_rel, &x_pos, NULL); + assert(g_graph_node_has_x_position(node->pending_pos.relative_ref)); + g_graph_node_get_position(node->pending_pos.relative_ref, &x_pos, NULL); x_pos += EDGE_SLOT_HORIZ_MARGIN + node->pending_pos.left_margin; g_graph_node_set_x_position(node, x_pos); break; case PPF_RIGHT_MARGIN: - assert(g_graph_node_has_x_position(node->pending_rel)); - g_graph_node_get_position(node->pending_rel, &x_pos, NULL); + assert(g_graph_node_has_x_position(node->pending_pos.relative_ref)); + g_graph_node_get_position(node->pending_pos.relative_ref, &x_pos, NULL); x_pos += node->pending_pos.right_margin; x_pos -= (EDGE_SLOT_HORIZ_MARGIN + node->alloc.width); g_graph_node_set_x_position(node, x_pos); @@ -304,7 +304,6 @@ void g_graph_node_set_x_position(GGraphNode *node, gint x) * Paramètres : node = noeud graphique à manipuler. * * flag = nature de l'indication à intégrer. * * pos = argument supplémentaire à venir chercher. * -* rel = éventuelle référence pour une relation relative. * * * * Description : Prépare la position du noeud pour l'alignement des liens. * * * @@ -314,14 +313,13 @@ void g_graph_node_set_x_position(GGraphNode *node, gint x) * * ******************************************************************************/ -void g_graph_node_set_pending_position(GGraphNode *node, PendingPositionFlags flag, pending_position pos, GGraphNode *rel) +void g_graph_node_set_pending_position(GGraphNode *node, PendingPositionFlags flag, pending_position pos) { - if (node->pending_flag != PPF_NONE) + if (node->pending_flag != PPF_NONE && node->pending_flag != PPF_MIDDLE_OF) return; - node->pending_pos = pos; node->pending_flag = flag; - node->pending_rel = rel; + node->pending_pos = pos; } @@ -342,9 +340,11 @@ void g_graph_node_set_pending_position(GGraphNode *node, PendingPositionFlags fl void g_graph_node_get_pending_position(GGraphNode *node, PendingPositionFlags *flag, pending_position *pos) { - *pos = node->pending_pos; *flag = node->pending_flag; + if (pos != NULL) + *pos = node->pending_pos; + } |