emit "alpha_changed" if the drawable got/lost an alpha channel by setting

2004-03-15  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.c (gimp_drawable_real_set_tiles): emit
	"alpha_changed" if the drawable got/lost an alpha channel by
	setting the new tiles.

	* app/core/gimpimage-undo-push.c (undo_pop_layer_mod)
	* app/core/gimplayer.c (gimp_layer_add_alpha): removed explicit
	calls to gimp_drawable_alpha_changed().
This commit is contained in:
Michael Natterer 2004-03-15 15:37:12 +00:00 committed by Michael Natterer
parent caa462bfd8
commit d376ac5d5e
4 changed files with 20 additions and 7 deletions

View file

@ -1,3 +1,13 @@
2004-03-15 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.c (gimp_drawable_real_set_tiles): emit
"alpha_changed" if the drawable got/lost an alpha channel by
setting the new tiles.
* app/core/gimpimage-undo-push.c (undo_pop_layer_mod)
* app/core/gimplayer.c (gimp_layer_add_alpha): removed explicit
calls to gimp_drawable_alpha_changed().
2004-03-15 Michael Natterer <mitch@gimp.org>
Closer to text layer undo:

View file

@ -600,8 +600,12 @@ gimp_drawable_real_set_tiles (GimpDrawable *drawable,
TileManager *tiles,
GimpImageType type)
{
gboolean old_has_alpha;
g_return_if_fail (tile_manager_bpp (tiles) == GIMP_IMAGE_TYPE_BYTES (type));
old_has_alpha = gimp_drawable_has_alpha (drawable);
if (drawable->tiles)
tile_manager_unref (drawable->tiles);
@ -609,6 +613,9 @@ gimp_drawable_real_set_tiles (GimpDrawable *drawable,
drawable->type = type;
drawable->bytes = tile_manager_bpp (tiles);
drawable->has_alpha = GIMP_IMAGE_TYPE_HAS_ALPHA (type);
if (old_has_alpha != gimp_drawable_has_alpha (drawable))
gimp_drawable_alpha_changed (drawable);
}
static void

View file

@ -1426,12 +1426,10 @@ undo_pop_layer_mod (GimpUndo *undo,
}
if (GIMP_IMAGE_TYPE_HAS_ALPHA (GIMP_DRAWABLE (layer)->type) !=
GIMP_IMAGE_TYPE_HAS_ALPHA (lmu->type))
GIMP_IMAGE_TYPE_HAS_ALPHA (lmu->type) &&
undo->gimage->layers->num_children == 1)
{
gimp_drawable_alpha_changed (GIMP_DRAWABLE (layer));
if (undo->gimage->layers->num_children == 1)
gimp_image_alpha_changed (undo->gimage);
gimp_image_alpha_changed (undo->gimage);
}
if (GIMP_ITEM (layer)->width != tile_manager_width (lmu->tiles) ||

View file

@ -1406,8 +1406,6 @@ gimp_layer_add_alpha (GimpLayer *layer)
GIMP_DRAWABLE (layer)->preview_valid = FALSE;
gimp_drawable_alpha_changed (GIMP_DRAWABLE (layer));
if (gimp_container_num_children (gimage->layers) == 1)
gimp_image_alpha_changed (gimage);
}