Revert the order of LdDiagram objects.
Now they go from oldest to newest.
This commit is contained in:
parent
cb278a2bf1
commit
6854c8a643
|
@ -890,7 +890,7 @@ get_object_at_coords (LdCanvas *self, gdouble x, gdouble y)
|
||||||
|
|
||||||
/* Iterate from the top object downwards. */
|
/* Iterate from the top object downwards. */
|
||||||
objects = (GList *) ld_diagram_get_objects (self->priv->diagram);
|
objects = (GList *) ld_diagram_get_objects (self->priv->diagram);
|
||||||
for (iter = objects; iter; iter = g_list_next (iter))
|
for (iter = g_list_last (objects); iter; iter = g_list_previous (iter))
|
||||||
{
|
{
|
||||||
LdDiagramObject *object;
|
LdDiagramObject *object;
|
||||||
|
|
||||||
|
@ -1182,7 +1182,7 @@ on_button_press (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
|
||||||
move_object_to_coords (self, data->object, event->x, event->y);
|
move_object_to_coords (self, data->object, event->x, event->y);
|
||||||
|
|
||||||
if (self->priv->diagram)
|
if (self->priv->diagram)
|
||||||
ld_diagram_insert_object (self->priv->diagram, data->object, 0);
|
ld_diagram_insert_object (self->priv->diagram, data->object, -1);
|
||||||
|
|
||||||
/* XXX: "cancel" causes confusion. */
|
/* XXX: "cancel" causes confusion. */
|
||||||
ld_canvas_real_cancel_operation (self);
|
ld_canvas_real_cancel_operation (self);
|
||||||
|
@ -1338,7 +1338,7 @@ draw_diagram (GtkWidget *widget, DrawData *data)
|
||||||
|
|
||||||
/* Draw objects from the diagram, from bottom to top. */
|
/* Draw objects from the diagram, from bottom to top. */
|
||||||
objects = (GList *) ld_diagram_get_objects (data->self->priv->diagram);
|
objects = (GList *) ld_diagram_get_objects (data->self->priv->diagram);
|
||||||
for (iter = g_list_last (objects); iter; iter = g_list_previous (iter))
|
for (iter = objects; iter; iter = g_list_next (iter))
|
||||||
draw_object (LD_DIAGRAM_OBJECT (iter->data), data);
|
draw_object (LD_DIAGRAM_OBJECT (iter->data), data);
|
||||||
|
|
||||||
switch (data->self->priv->operation)
|
switch (data->self->priv->operation)
|
||||||
|
|
|
@ -461,8 +461,7 @@ serialize_diagram (LdDiagram *self)
|
||||||
json_node_take_object (root_node, root_object);
|
json_node_take_object (root_node, root_object);
|
||||||
|
|
||||||
objects_array = json_array_new ();
|
objects_array = json_array_new ();
|
||||||
iter = g_list_last (self->priv->objects);
|
for (iter = self->priv->objects; iter; iter = g_list_next (iter))
|
||||||
for (; iter; iter = g_list_previous (iter))
|
|
||||||
json_array_add_element (objects_array,
|
json_array_add_element (objects_array,
|
||||||
serialize_object (LD_DIAGRAM_OBJECT (iter->data)));
|
serialize_object (LD_DIAGRAM_OBJECT (iter->data)));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue