Commit f8e9fbc1 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

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.
parent 8e43a403
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
......@@ -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;
}
......
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