Commit c3b7be24 authored by Martin Nordholts's avatar Martin Nordholts
Browse files

Instantiate offset_node on-demand.

* app/core/gimpitem.c: Instantiate offset_node on-demand.

* app/core/gimpdrawable.c: Use gimp_item_set_offset().

svn path=/trunk/; revision=27530
parent 5b68a1d0
2008-11-03 Martin Nordholts <martinn@svn.gnome.org>
* app/core/gimpitem.c: Instantiate offset_node on-demand.
* app/core/gimpdrawable.c: Use gimp_item_set_offset().
2008-11-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpitem.[ch]: renamed
......@@ -31,8 +37,8 @@
2008-11-02 Martin Nordholts <martinn@svn.gnome.org>
* app/core/gimpitem.c (gimp_item_set_offsets): New function that
sets the offset of the item and also keeps the offset_node in
* app/core/gimpitem.[ch] (gimp_item_set_offsets): New function
that sets the offset of the item and also keeps the offset_node in
sync.
* app/core/gimpdrawable.c (gimp_drawable_real_set_tiles): Use the
......
......@@ -748,7 +748,7 @@ gimp_drawable_real_set_tiles (GimpDrawable *drawable,
drawable->bytes = tile_manager_bpp (tiles);
drawable->has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (type);
gimp_item_set_offsets (item, offset_x, offset_y);
gimp_item_set_offset (item, offset_x, offset_y);
if (gimp_item_width (item) != tile_manager_width (tiles) ||
gimp_item_height (item) != tile_manager_height (tiles))
......
......@@ -454,11 +454,6 @@ gimp_item_real_get_node (GimpItem *item)
{
item->node = gegl_node_new ();
item->offset_node = gegl_node_new_child (item->node,
"operation", "gegl:shift",
"x", (gdouble) item->offset_x,
"y", (gdouble) item->offset_y,
NULL);
return item->node;
}
......@@ -693,7 +688,7 @@ gimp_item_height (const GimpItem *item)
}
/**
* gimp_item_get_offsets:
* gimp_item_get_offset:
* @item: The #GimpItem to check.
* @offset_x: Return location for the item's X offset.
* @offset_y: Return location for the item's Y offset.
......@@ -1141,7 +1136,15 @@ gimp_item_get_offset_node (GimpItem *item)
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
if (! item->offset_node)
gimp_item_get_node (item);
{
GeglNode *node = gimp_item_get_node (item);
item->offset_node = gegl_node_new_child (node,
"operation", "gegl:shift",
"x", (gdouble) item->offset_x,
"y", (gdouble) item->offset_y,
NULL);
}
return item->offset_node;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment