removed broken code which tried to figure manually whether "alpha_changed"

2004-01-18  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage-undo-push.c (undo_pop_layer): removed broken
	code which tried to figure manually whether "alpha_changed" should
	be emitted. Instead, simply compare the return values of
	gimp_image_has_alpha() before and after adding/removing the
	layer. Fixes bug #131721.
This commit is contained in:
Michael Natterer 2004-01-18 00:36:02 +00:00 committed by Michael Natterer
parent 8e43a403f7
commit f8e9fbc17c
2 changed files with 14 additions and 12 deletions

View File

@ -1,3 +1,11 @@
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-undo-push.c (undo_pop_layer): removed broken
code which tried to figure manually whether "alpha_changed" should
be emitted. Instead, simply compare the return values of
gimp_image_has_alpha() before and after adding/removing the
layer. Fixes bug #131721.
2004-01-17 Henrik Brix Andersen <brix@gimp.org>
* app/core/gimpimage-snap.c (gimp_image_snap_point): forgot to

View File

@ -1484,11 +1484,14 @@ undo_pop_layer (GimpUndo *undo,
{
LayerUndo *lu;
GimpLayer *layer;
gboolean old_has_alpha;
lu = (LayerUndo *) undo->data;
layer = GIMP_LAYER (GIMP_ITEM_UNDO (undo)->item);
old_has_alpha = gimp_image_has_alpha (undo->gimage);
if ((undo_mode == GIMP_UNDO_MODE_UNDO &&
undo->undo_type == GIMP_UNDO_LAYER_ADD) ||
(undo_mode == GIMP_UNDO_MODE_REDO &&
@ -1542,12 +1545,6 @@ undo_pop_layer (GimpUndo *undo,
}
gimp_item_removed (GIMP_ITEM (layer));
if (gimp_container_num_children (undo->gimage->layers) == 1 &&
! gimp_drawable_has_alpha (GIMP_LIST (undo->gimage->layers)->list->data))
{
accum->alpha_changed = TRUE;
}
}
else
{
@ -1570,12 +1567,6 @@ undo_pop_layer (GimpUndo *undo,
if (gimp_layer_is_floating_sel (layer))
undo->gimage->floating_sel = layer;
if (gimp_container_num_children (undo->gimage->layers) == 1 &&
! gimp_drawable_has_alpha (GIMP_LIST (undo->gimage->layers)->list->data))
{
accum->alpha_changed = TRUE;
}
/* add the new layer */
gimp_container_insert (undo->gimage->layers,
GIMP_OBJECT (layer), lu->prev_position);
@ -1585,6 +1576,9 @@ undo_pop_layer (GimpUndo *undo,
gimp_image_floating_selection_changed (undo->gimage);
}
if (old_has_alpha != gimp_image_has_alpha (undo->gimage))
accum->alpha_changed = TRUE;
return TRUE;
}