diff options
Diffstat (limited to 'src/gtkext/graph/node.c')
-rw-r--r-- | src/gtkext/graph/node.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gtkext/graph/node.c b/src/gtkext/graph/node.c index 3801d1a..ec09941 100644 --- a/src/gtkext/graph/node.c +++ b/src/gtkext/graph/node.c @@ -24,6 +24,7 @@ #include "node.h" +#include <assert.h> #include <malloc.h> #include <stdio.h> #include <string.h> @@ -258,6 +259,8 @@ void g_graph_node_reset_position(GGraphNode *node) node->alloc.x = UNINITIALIZED_NODE_POS; node->alloc.y = UNINITIALIZED_NODE_POS; + node->pending_flag = PPF_NONE; + if (node->reset_pos != NULL) node->reset_pos(node); @@ -307,18 +310,21 @@ 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); 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); 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); x_pos += node->pending_pos.right_margin; x_pos -= (EDGE_SLOT_HORIZ_MARGIN + node->alloc.width); @@ -386,6 +392,9 @@ 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) { + if (node->pending_flag != PPF_NONE) + return; + node->pending_pos = pos; node->pending_flag = flag; node->pending_rel = rel; |