aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2011-01-09 06:05:43 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2011-01-09 06:05:43 +0100
commit8243114d0924982590fb81f0ecb54b39fef41c9e (patch)
tree6c8d115ae8a62cd6e68bd3c31c5a183b765e6fba /src
parent911fac4c2f32847da4891d4e22cfd248c908d607 (diff)
downloadlogdiag-8243114d0924982590fb81f0ecb54b39fef41c9e.tar.gz
logdiag-8243114d0924982590fb81f0ecb54b39fef41c9e.tar.xz
logdiag-8243114d0924982590fb81f0ecb54b39fef41c9e.zip
Draw diagram objects in reversed order.
Previously older objects drew on top of newer ones.
Diffstat (limited to 'src')
-rw-r--r--src/ld-canvas.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ld-canvas.c b/src/ld-canvas.c
index bacef26..2ea676a 100644
--- a/src/ld-canvas.c
+++ b/src/ld-canvas.c
@@ -1246,18 +1246,18 @@ draw_terminal (GtkWidget *widget, DrawData *data)
static void
draw_diagram (GtkWidget *widget, DrawData *data)
{
- GList *objects;
+ GList *objects, *iter;
if (!data->self->priv->diagram)
return;
cairo_save (data->cr);
-
cairo_set_line_width (data->cr, 1 / data->scale);
- /* Draw objects from the diagram. */
- objects = ld_diagram_get_objects (data->self->priv->diagram);
- g_list_foreach (objects, (GFunc) draw_object, data);
+ /* Draw objects from the diagram, from bottom to top. */
+ objects = (GList *) ld_diagram_get_objects (data->self->priv->diagram);
+ for (iter = g_list_last (objects); iter; iter = g_list_previous (iter))
+ draw_object (LD_DIAGRAM_OBJECT (iter->data), data);
switch (data->self->priv->operation)
{