summaryrefslogtreecommitdiff
path: root/src/gtkext/graph/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtkext/graph/node.c')
-rw-r--r--src/gtkext/graph/node.c24
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;
+
}