From 1fdea67422eae2b2d8d3c6c20bfdf69b8fdef963 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 30 Nov 1999 00:18:44 +0000 Subject: [PATCH] fix bug #2168 --Sven --- ChangeLog | 5 +++++ app/core/gimpimage-guides.c | 10 ++++++---- app/core/gimpimage-merge.c | 10 ++++++---- app/core/gimpimage-projection.c | 10 ++++++---- app/core/gimpimage-resize.c | 10 ++++++---- app/core/gimpimage-scale.c | 10 ++++++---- app/core/gimpimage.c | 10 ++++++---- app/core/gimpprojection-construct.c | 10 ++++++---- app/gimpimage.c | 10 ++++++---- 9 files changed, 53 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index 746159333f..0574188ec1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Nov 30 01:17:12 MET 1999 Sven Neumann + + * app/gimpimage.c: correctly save the layer mode to the undo_stack + on layer_merge (fixes bug #2168) + Mon Nov 29 23:51:26 GMT 1999 Andy Thomas * app/commands.c diff --git a/app/core/gimpimage-guides.c b/app/core/gimpimage-guides.c index 63cc873633..418203a190 100644 --- a/app/core/gimpimage-guides.c +++ b/app/core/gimpimage-guides.c @@ -2397,6 +2397,7 @@ gimp_image_merge_layers (GimpImage *gimage, Layer *merge_layer; Layer *layer; Layer *bottom; + gint bottom_mode; guchar bg[4] = {0, 0, 0, 0}; GimpImageType type; gint count; @@ -2411,6 +2412,7 @@ gimp_image_merge_layers (GimpImage *gimage, type = RGBA_GIMAGE; x1 = y1 = x2 = y2 = 0; bottom = NULL; + bottom_mode = 0; /* Get the layer extents */ count = 0; @@ -2549,9 +2551,9 @@ gimp_image_merge_layers (GimpImage *gimage, * Keep a pointer to it so that we can set the mode right after it's been * merged so that undo works correctly. */ - layer->mode = NORMAL_MODE; bottom = layer; - + bottom_mode = bottom->mode; + bottom->mode = NORMAL_MODE; } while (reverse_list) @@ -2597,7 +2599,7 @@ gimp_image_merge_layers (GimpImage *gimage, /* Save old mode in undo */ if (bottom) - bottom -> mode = merge_layer -> mode; + bottom->mode = bottom_mode; g_slist_free (reverse_list); @@ -3389,7 +3391,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage, floating_sel = layer; else { - if (floating_sel && GIMP_LAYER (floating_sel)->fs.drawable == layer) + if (floating_sel && floating_sel->fs.drawable == GIMP_DRAWABLE (layer)) reverse_list = g_slist_prepend (reverse_list, floating_sel); reverse_list = g_slist_prepend (reverse_list, layer); diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c index 63cc873633..418203a190 100644 --- a/app/core/gimpimage-merge.c +++ b/app/core/gimpimage-merge.c @@ -2397,6 +2397,7 @@ gimp_image_merge_layers (GimpImage *gimage, Layer *merge_layer; Layer *layer; Layer *bottom; + gint bottom_mode; guchar bg[4] = {0, 0, 0, 0}; GimpImageType type; gint count; @@ -2411,6 +2412,7 @@ gimp_image_merge_layers (GimpImage *gimage, type = RGBA_GIMAGE; x1 = y1 = x2 = y2 = 0; bottom = NULL; + bottom_mode = 0; /* Get the layer extents */ count = 0; @@ -2549,9 +2551,9 @@ gimp_image_merge_layers (GimpImage *gimage, * Keep a pointer to it so that we can set the mode right after it's been * merged so that undo works correctly. */ - layer->mode = NORMAL_MODE; bottom = layer; - + bottom_mode = bottom->mode; + bottom->mode = NORMAL_MODE; } while (reverse_list) @@ -2597,7 +2599,7 @@ gimp_image_merge_layers (GimpImage *gimage, /* Save old mode in undo */ if (bottom) - bottom -> mode = merge_layer -> mode; + bottom->mode = bottom_mode; g_slist_free (reverse_list); @@ -3389,7 +3391,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage, floating_sel = layer; else { - if (floating_sel && GIMP_LAYER (floating_sel)->fs.drawable == layer) + if (floating_sel && floating_sel->fs.drawable == GIMP_DRAWABLE (layer)) reverse_list = g_slist_prepend (reverse_list, floating_sel); reverse_list = g_slist_prepend (reverse_list, layer); diff --git a/app/core/gimpimage-projection.c b/app/core/gimpimage-projection.c index 63cc873633..418203a190 100644 --- a/app/core/gimpimage-projection.c +++ b/app/core/gimpimage-projection.c @@ -2397,6 +2397,7 @@ gimp_image_merge_layers (GimpImage *gimage, Layer *merge_layer; Layer *layer; Layer *bottom; + gint bottom_mode; guchar bg[4] = {0, 0, 0, 0}; GimpImageType type; gint count; @@ -2411,6 +2412,7 @@ gimp_image_merge_layers (GimpImage *gimage, type = RGBA_GIMAGE; x1 = y1 = x2 = y2 = 0; bottom = NULL; + bottom_mode = 0; /* Get the layer extents */ count = 0; @@ -2549,9 +2551,9 @@ gimp_image_merge_layers (GimpImage *gimage, * Keep a pointer to it so that we can set the mode right after it's been * merged so that undo works correctly. */ - layer->mode = NORMAL_MODE; bottom = layer; - + bottom_mode = bottom->mode; + bottom->mode = NORMAL_MODE; } while (reverse_list) @@ -2597,7 +2599,7 @@ gimp_image_merge_layers (GimpImage *gimage, /* Save old mode in undo */ if (bottom) - bottom -> mode = merge_layer -> mode; + bottom->mode = bottom_mode; g_slist_free (reverse_list); @@ -3389,7 +3391,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage, floating_sel = layer; else { - if (floating_sel && GIMP_LAYER (floating_sel)->fs.drawable == layer) + if (floating_sel && floating_sel->fs.drawable == GIMP_DRAWABLE (layer)) reverse_list = g_slist_prepend (reverse_list, floating_sel); reverse_list = g_slist_prepend (reverse_list, layer); diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c index 63cc873633..418203a190 100644 --- a/app/core/gimpimage-resize.c +++ b/app/core/gimpimage-resize.c @@ -2397,6 +2397,7 @@ gimp_image_merge_layers (GimpImage *gimage, Layer *merge_layer; Layer *layer; Layer *bottom; + gint bottom_mode; guchar bg[4] = {0, 0, 0, 0}; GimpImageType type; gint count; @@ -2411,6 +2412,7 @@ gimp_image_merge_layers (GimpImage *gimage, type = RGBA_GIMAGE; x1 = y1 = x2 = y2 = 0; bottom = NULL; + bottom_mode = 0; /* Get the layer extents */ count = 0; @@ -2549,9 +2551,9 @@ gimp_image_merge_layers (GimpImage *gimage, * Keep a pointer to it so that we can set the mode right after it's been * merged so that undo works correctly. */ - layer->mode = NORMAL_MODE; bottom = layer; - + bottom_mode = bottom->mode; + bottom->mode = NORMAL_MODE; } while (reverse_list) @@ -2597,7 +2599,7 @@ gimp_image_merge_layers (GimpImage *gimage, /* Save old mode in undo */ if (bottom) - bottom -> mode = merge_layer -> mode; + bottom->mode = bottom_mode; g_slist_free (reverse_list); @@ -3389,7 +3391,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage, floating_sel = layer; else { - if (floating_sel && GIMP_LAYER (floating_sel)->fs.drawable == layer) + if (floating_sel && floating_sel->fs.drawable == GIMP_DRAWABLE (layer)) reverse_list = g_slist_prepend (reverse_list, floating_sel); reverse_list = g_slist_prepend (reverse_list, layer); diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c index 63cc873633..418203a190 100644 --- a/app/core/gimpimage-scale.c +++ b/app/core/gimpimage-scale.c @@ -2397,6 +2397,7 @@ gimp_image_merge_layers (GimpImage *gimage, Layer *merge_layer; Layer *layer; Layer *bottom; + gint bottom_mode; guchar bg[4] = {0, 0, 0, 0}; GimpImageType type; gint count; @@ -2411,6 +2412,7 @@ gimp_image_merge_layers (GimpImage *gimage, type = RGBA_GIMAGE; x1 = y1 = x2 = y2 = 0; bottom = NULL; + bottom_mode = 0; /* Get the layer extents */ count = 0; @@ -2549,9 +2551,9 @@ gimp_image_merge_layers (GimpImage *gimage, * Keep a pointer to it so that we can set the mode right after it's been * merged so that undo works correctly. */ - layer->mode = NORMAL_MODE; bottom = layer; - + bottom_mode = bottom->mode; + bottom->mode = NORMAL_MODE; } while (reverse_list) @@ -2597,7 +2599,7 @@ gimp_image_merge_layers (GimpImage *gimage, /* Save old mode in undo */ if (bottom) - bottom -> mode = merge_layer -> mode; + bottom->mode = bottom_mode; g_slist_free (reverse_list); @@ -3389,7 +3391,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage, floating_sel = layer; else { - if (floating_sel && GIMP_LAYER (floating_sel)->fs.drawable == layer) + if (floating_sel && floating_sel->fs.drawable == GIMP_DRAWABLE (layer)) reverse_list = g_slist_prepend (reverse_list, floating_sel); reverse_list = g_slist_prepend (reverse_list, layer); diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index 63cc873633..418203a190 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -2397,6 +2397,7 @@ gimp_image_merge_layers (GimpImage *gimage, Layer *merge_layer; Layer *layer; Layer *bottom; + gint bottom_mode; guchar bg[4] = {0, 0, 0, 0}; GimpImageType type; gint count; @@ -2411,6 +2412,7 @@ gimp_image_merge_layers (GimpImage *gimage, type = RGBA_GIMAGE; x1 = y1 = x2 = y2 = 0; bottom = NULL; + bottom_mode = 0; /* Get the layer extents */ count = 0; @@ -2549,9 +2551,9 @@ gimp_image_merge_layers (GimpImage *gimage, * Keep a pointer to it so that we can set the mode right after it's been * merged so that undo works correctly. */ - layer->mode = NORMAL_MODE; bottom = layer; - + bottom_mode = bottom->mode; + bottom->mode = NORMAL_MODE; } while (reverse_list) @@ -2597,7 +2599,7 @@ gimp_image_merge_layers (GimpImage *gimage, /* Save old mode in undo */ if (bottom) - bottom -> mode = merge_layer -> mode; + bottom->mode = bottom_mode; g_slist_free (reverse_list); @@ -3389,7 +3391,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage, floating_sel = layer; else { - if (floating_sel && GIMP_LAYER (floating_sel)->fs.drawable == layer) + if (floating_sel && floating_sel->fs.drawable == GIMP_DRAWABLE (layer)) reverse_list = g_slist_prepend (reverse_list, floating_sel); reverse_list = g_slist_prepend (reverse_list, layer); diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index 63cc873633..418203a190 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -2397,6 +2397,7 @@ gimp_image_merge_layers (GimpImage *gimage, Layer *merge_layer; Layer *layer; Layer *bottom; + gint bottom_mode; guchar bg[4] = {0, 0, 0, 0}; GimpImageType type; gint count; @@ -2411,6 +2412,7 @@ gimp_image_merge_layers (GimpImage *gimage, type = RGBA_GIMAGE; x1 = y1 = x2 = y2 = 0; bottom = NULL; + bottom_mode = 0; /* Get the layer extents */ count = 0; @@ -2549,9 +2551,9 @@ gimp_image_merge_layers (GimpImage *gimage, * Keep a pointer to it so that we can set the mode right after it's been * merged so that undo works correctly. */ - layer->mode = NORMAL_MODE; bottom = layer; - + bottom_mode = bottom->mode; + bottom->mode = NORMAL_MODE; } while (reverse_list) @@ -2597,7 +2599,7 @@ gimp_image_merge_layers (GimpImage *gimage, /* Save old mode in undo */ if (bottom) - bottom -> mode = merge_layer -> mode; + bottom->mode = bottom_mode; g_slist_free (reverse_list); @@ -3389,7 +3391,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage, floating_sel = layer; else { - if (floating_sel && GIMP_LAYER (floating_sel)->fs.drawable == layer) + if (floating_sel && floating_sel->fs.drawable == GIMP_DRAWABLE (layer)) reverse_list = g_slist_prepend (reverse_list, floating_sel); reverse_list = g_slist_prepend (reverse_list, layer); diff --git a/app/gimpimage.c b/app/gimpimage.c index 63cc873633..418203a190 100644 --- a/app/gimpimage.c +++ b/app/gimpimage.c @@ -2397,6 +2397,7 @@ gimp_image_merge_layers (GimpImage *gimage, Layer *merge_layer; Layer *layer; Layer *bottom; + gint bottom_mode; guchar bg[4] = {0, 0, 0, 0}; GimpImageType type; gint count; @@ -2411,6 +2412,7 @@ gimp_image_merge_layers (GimpImage *gimage, type = RGBA_GIMAGE; x1 = y1 = x2 = y2 = 0; bottom = NULL; + bottom_mode = 0; /* Get the layer extents */ count = 0; @@ -2549,9 +2551,9 @@ gimp_image_merge_layers (GimpImage *gimage, * Keep a pointer to it so that we can set the mode right after it's been * merged so that undo works correctly. */ - layer->mode = NORMAL_MODE; bottom = layer; - + bottom_mode = bottom->mode; + bottom->mode = NORMAL_MODE; } while (reverse_list) @@ -2597,7 +2599,7 @@ gimp_image_merge_layers (GimpImage *gimage, /* Save old mode in undo */ if (bottom) - bottom -> mode = merge_layer -> mode; + bottom->mode = bottom_mode; g_slist_free (reverse_list); @@ -3389,7 +3391,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage, floating_sel = layer; else { - if (floating_sel && GIMP_LAYER (floating_sel)->fs.drawable == layer) + if (floating_sel && floating_sel->fs.drawable == GIMP_DRAWABLE (layer)) reverse_list = g_slist_prepend (reverse_list, floating_sel); reverse_list = g_slist_prepend (reverse_list, layer);