Add and use gimp_drawable_update_tile_source_node()

Collect logic to update the tile_source_node in a new helper function
gimp_drawable_update_tile_source_node().

svn path=/trunk/; revision=27976
This commit is contained in:
Martin Nordholts 2009-02-01 18:55:56 +00:00
parent 2716d25dd5
commit da9ddd3398
2 changed files with 22 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2009-02-01 Martin Nordholts <martinn@svn.gnome.org>
* app/core/gimpdrawable.c: Collect logic to update the
tile_source_node in a new helper function
gimp_drawable_update_tile_source_node().
2009-02-01 Martin Nordholts <martinn@svn.gnome.org>
Applied patch from Alexia Death that prepares brushes for

View File

@ -717,6 +717,20 @@ gimp_drawable_real_get_tiles (GimpDrawable *drawable)
return drawable->tiles;
}
static void
gimp_drawable_update_tile_source_node (GimpDrawable *drawable)
{
if (! drawable->tile_source_node)
return;
if (drawable->tiles)
{
gegl_node_set (drawable->tile_source_node,
"tile-manager", drawable->tiles,
NULL);
}
}
static void
gimp_drawable_real_set_tiles (GimpDrawable *drawable,
gboolean push_undo,
@ -766,10 +780,7 @@ gimp_drawable_real_set_tiles (GimpDrawable *drawable,
if (old_has_alpha != gimp_drawable_has_alpha (drawable))
gimp_drawable_alpha_changed (drawable);
if (drawable->tile_source_node)
gegl_node_set (drawable->tile_source_node,
"tile-manager", drawable->tiles,
NULL);
gimp_drawable_update_tile_source_node (drawable);
}
static GeglNode *
@ -1068,10 +1079,7 @@ gimp_drawable_configure (GimpDrawable *drawable,
drawable->preview_cache = NULL;
drawable->preview_valid = FALSE;
if (drawable->tile_source_node)
gegl_node_set (drawable->tile_source_node,
"tile-manager", drawable->tiles,
NULL);
gimp_drawable_update_tile_source_node (drawable);
}
void