compress successive layer mode undos just as we compress opacity undos.

2003-11-19  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimplayertreeview.c
	(gimp_layer_tree_view_paint_mode_menu_callback): compress
	successive layer mode undos just as we compress opacity undos.
This commit is contained in:
Michael Natterer 2003-11-19 17:03:20 +00:00 committed by Michael Natterer
parent 86f45eabc2
commit 95ae8410d7
2 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2003-11-19 Michael Natterer <mitch@gimp.org>
* app/widgets/gimplayertreeview.c
(gimp_layer_tree_view_paint_mode_menu_callback): compress
successive layer mode undos just as we compress opacity undos.
2003-11-19 Michael Natterer <mitch@gimp.org>
* plug-ins/FractalExplorer/Dialogs.c

View file

@ -811,8 +811,19 @@ gimp_layer_tree_view_paint_mode_menu_callback (GtkWidget *widget,
if (gimp_layer_get_mode (layer) != mode)
{
GimpUndo *undo;
gboolean push_undo = TRUE;
undo = gimp_undo_stack_peek (gimage->undo_stack);
/* compress layer mode undos */
if (GIMP_IS_ITEM_UNDO (undo) &&
undo->undo_type == GIMP_UNDO_LAYER_MODE &&
GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (layer))
push_undo = FALSE;
BLOCK();
gimp_layer_set_mode (layer, mode, TRUE);
gimp_layer_set_mode (layer, mode, push_undo);
UNBLOCK();
gimp_image_flush (gimage);