diff --git a/ChangeLog b/ChangeLog index 213bbf65a8..9512b65043 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-05-12 Jay Cox + + * app/gimpimage.c: Copy the name, tatto and parasites of the + bottom layer to the new merged layer in gimp_image_merge_layers. + 2000-05-11 Tor Lillqvist * PLUGIN_MAINTAINERS diff --git a/app/core/gimpimage-guides.c b/app/core/gimpimage-guides.c index 72f8e68b4e..4034f1c9e1 100644 --- a/app/core/gimpimage-guides.c +++ b/app/core/gimpimage-guides.c @@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage, } /* Don't forget the selection mask! */ + /* if (channel_is_empty(gimage->selection_mask)) + channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + else + */ + channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); @@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage, gint position; gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint off_x, off_y; + char *name; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2706,6 +2712,8 @@ gimp_image_merge_layers (GimpImage *gimage, /* Start a merge undo group */ undo_push_group_start (gimage, LAYER_MERGE_UNDO); + name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer))); + if (merge_type == FLATTEN_IMAGE || drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) { @@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage, * whether or not the original did * Opacity is set to 100% and the MODE is set to normal */ + merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), drawable_type_with_alpha (GIMP_DRAWABLE(layer)), - drawable_get_name (GIMP_DRAWABLE(layer)), + "merged layer", OPAQUE_OPACITY, NORMAL_MODE); + if (!merge_layer) { g_message ("gimp_image_merge_layers: could not allocate merge layer"); @@ -2780,6 +2790,12 @@ gimp_image_merge_layers (GimpImage *gimage, bottom->mode = NORMAL_MODE; } + /* Copy the tattoo and parasites of the bottom layer to the new layer */ + layer_set_tattoo(merge_layer, layer_get_tattoo(layer)); + GIMP_DRAWABLE(merge_layer)->parasites + = parasite_list_copy(GIMP_DRAWABLE(layer)->parasites); + + while (reverse_list) { layer = (Layer *) reverse_list->data; @@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage, (g_slist_length (gimage->layers) - position + 1)); } + /* set the name after the original layers have been removed so we don't + end up with #2 appended to the name */ + drawable_set_name (GIMP_DRAWABLE(merge_layer), name); + g_free(name); + /* End the merge undo group */ undo_push_group_end (gimage); diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c index 72f8e68b4e..4034f1c9e1 100644 --- a/app/core/gimpimage-merge.c +++ b/app/core/gimpimage-merge.c @@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage, } /* Don't forget the selection mask! */ + /* if (channel_is_empty(gimage->selection_mask)) + channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + else + */ + channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); @@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage, gint position; gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint off_x, off_y; + char *name; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2706,6 +2712,8 @@ gimp_image_merge_layers (GimpImage *gimage, /* Start a merge undo group */ undo_push_group_start (gimage, LAYER_MERGE_UNDO); + name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer))); + if (merge_type == FLATTEN_IMAGE || drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) { @@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage, * whether or not the original did * Opacity is set to 100% and the MODE is set to normal */ + merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), drawable_type_with_alpha (GIMP_DRAWABLE(layer)), - drawable_get_name (GIMP_DRAWABLE(layer)), + "merged layer", OPAQUE_OPACITY, NORMAL_MODE); + if (!merge_layer) { g_message ("gimp_image_merge_layers: could not allocate merge layer"); @@ -2780,6 +2790,12 @@ gimp_image_merge_layers (GimpImage *gimage, bottom->mode = NORMAL_MODE; } + /* Copy the tattoo and parasites of the bottom layer to the new layer */ + layer_set_tattoo(merge_layer, layer_get_tattoo(layer)); + GIMP_DRAWABLE(merge_layer)->parasites + = parasite_list_copy(GIMP_DRAWABLE(layer)->parasites); + + while (reverse_list) { layer = (Layer *) reverse_list->data; @@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage, (g_slist_length (gimage->layers) - position + 1)); } + /* set the name after the original layers have been removed so we don't + end up with #2 appended to the name */ + drawable_set_name (GIMP_DRAWABLE(merge_layer), name); + g_free(name); + /* End the merge undo group */ undo_push_group_end (gimage); diff --git a/app/core/gimpimage-projection.c b/app/core/gimpimage-projection.c index 72f8e68b4e..4034f1c9e1 100644 --- a/app/core/gimpimage-projection.c +++ b/app/core/gimpimage-projection.c @@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage, } /* Don't forget the selection mask! */ + /* if (channel_is_empty(gimage->selection_mask)) + channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + else + */ + channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); @@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage, gint position; gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint off_x, off_y; + char *name; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2706,6 +2712,8 @@ gimp_image_merge_layers (GimpImage *gimage, /* Start a merge undo group */ undo_push_group_start (gimage, LAYER_MERGE_UNDO); + name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer))); + if (merge_type == FLATTEN_IMAGE || drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) { @@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage, * whether or not the original did * Opacity is set to 100% and the MODE is set to normal */ + merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), drawable_type_with_alpha (GIMP_DRAWABLE(layer)), - drawable_get_name (GIMP_DRAWABLE(layer)), + "merged layer", OPAQUE_OPACITY, NORMAL_MODE); + if (!merge_layer) { g_message ("gimp_image_merge_layers: could not allocate merge layer"); @@ -2780,6 +2790,12 @@ gimp_image_merge_layers (GimpImage *gimage, bottom->mode = NORMAL_MODE; } + /* Copy the tattoo and parasites of the bottom layer to the new layer */ + layer_set_tattoo(merge_layer, layer_get_tattoo(layer)); + GIMP_DRAWABLE(merge_layer)->parasites + = parasite_list_copy(GIMP_DRAWABLE(layer)->parasites); + + while (reverse_list) { layer = (Layer *) reverse_list->data; @@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage, (g_slist_length (gimage->layers) - position + 1)); } + /* set the name after the original layers have been removed so we don't + end up with #2 appended to the name */ + drawable_set_name (GIMP_DRAWABLE(merge_layer), name); + g_free(name); + /* End the merge undo group */ undo_push_group_end (gimage); diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c index 72f8e68b4e..4034f1c9e1 100644 --- a/app/core/gimpimage-resize.c +++ b/app/core/gimpimage-resize.c @@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage, } /* Don't forget the selection mask! */ + /* if (channel_is_empty(gimage->selection_mask)) + channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + else + */ + channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); @@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage, gint position; gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint off_x, off_y; + char *name; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2706,6 +2712,8 @@ gimp_image_merge_layers (GimpImage *gimage, /* Start a merge undo group */ undo_push_group_start (gimage, LAYER_MERGE_UNDO); + name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer))); + if (merge_type == FLATTEN_IMAGE || drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) { @@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage, * whether or not the original did * Opacity is set to 100% and the MODE is set to normal */ + merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), drawable_type_with_alpha (GIMP_DRAWABLE(layer)), - drawable_get_name (GIMP_DRAWABLE(layer)), + "merged layer", OPAQUE_OPACITY, NORMAL_MODE); + if (!merge_layer) { g_message ("gimp_image_merge_layers: could not allocate merge layer"); @@ -2780,6 +2790,12 @@ gimp_image_merge_layers (GimpImage *gimage, bottom->mode = NORMAL_MODE; } + /* Copy the tattoo and parasites of the bottom layer to the new layer */ + layer_set_tattoo(merge_layer, layer_get_tattoo(layer)); + GIMP_DRAWABLE(merge_layer)->parasites + = parasite_list_copy(GIMP_DRAWABLE(layer)->parasites); + + while (reverse_list) { layer = (Layer *) reverse_list->data; @@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage, (g_slist_length (gimage->layers) - position + 1)); } + /* set the name after the original layers have been removed so we don't + end up with #2 appended to the name */ + drawable_set_name (GIMP_DRAWABLE(merge_layer), name); + g_free(name); + /* End the merge undo group */ undo_push_group_end (gimage); diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c index 72f8e68b4e..4034f1c9e1 100644 --- a/app/core/gimpimage-scale.c +++ b/app/core/gimpimage-scale.c @@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage, } /* Don't forget the selection mask! */ + /* if (channel_is_empty(gimage->selection_mask)) + channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + else + */ + channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); @@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage, gint position; gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint off_x, off_y; + char *name; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2706,6 +2712,8 @@ gimp_image_merge_layers (GimpImage *gimage, /* Start a merge undo group */ undo_push_group_start (gimage, LAYER_MERGE_UNDO); + name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer))); + if (merge_type == FLATTEN_IMAGE || drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) { @@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage, * whether or not the original did * Opacity is set to 100% and the MODE is set to normal */ + merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), drawable_type_with_alpha (GIMP_DRAWABLE(layer)), - drawable_get_name (GIMP_DRAWABLE(layer)), + "merged layer", OPAQUE_OPACITY, NORMAL_MODE); + if (!merge_layer) { g_message ("gimp_image_merge_layers: could not allocate merge layer"); @@ -2780,6 +2790,12 @@ gimp_image_merge_layers (GimpImage *gimage, bottom->mode = NORMAL_MODE; } + /* Copy the tattoo and parasites of the bottom layer to the new layer */ + layer_set_tattoo(merge_layer, layer_get_tattoo(layer)); + GIMP_DRAWABLE(merge_layer)->parasites + = parasite_list_copy(GIMP_DRAWABLE(layer)->parasites); + + while (reverse_list) { layer = (Layer *) reverse_list->data; @@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage, (g_slist_length (gimage->layers) - position + 1)); } + /* set the name after the original layers have been removed so we don't + end up with #2 appended to the name */ + drawable_set_name (GIMP_DRAWABLE(merge_layer), name); + g_free(name); + /* End the merge undo group */ undo_push_group_end (gimage); diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index 72f8e68b4e..4034f1c9e1 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage, } /* Don't forget the selection mask! */ + /* if (channel_is_empty(gimage->selection_mask)) + channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + else + */ + channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); @@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage, gint position; gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint off_x, off_y; + char *name; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2706,6 +2712,8 @@ gimp_image_merge_layers (GimpImage *gimage, /* Start a merge undo group */ undo_push_group_start (gimage, LAYER_MERGE_UNDO); + name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer))); + if (merge_type == FLATTEN_IMAGE || drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) { @@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage, * whether or not the original did * Opacity is set to 100% and the MODE is set to normal */ + merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), drawable_type_with_alpha (GIMP_DRAWABLE(layer)), - drawable_get_name (GIMP_DRAWABLE(layer)), + "merged layer", OPAQUE_OPACITY, NORMAL_MODE); + if (!merge_layer) { g_message ("gimp_image_merge_layers: could not allocate merge layer"); @@ -2780,6 +2790,12 @@ gimp_image_merge_layers (GimpImage *gimage, bottom->mode = NORMAL_MODE; } + /* Copy the tattoo and parasites of the bottom layer to the new layer */ + layer_set_tattoo(merge_layer, layer_get_tattoo(layer)); + GIMP_DRAWABLE(merge_layer)->parasites + = parasite_list_copy(GIMP_DRAWABLE(layer)->parasites); + + while (reverse_list) { layer = (Layer *) reverse_list->data; @@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage, (g_slist_length (gimage->layers) - position + 1)); } + /* set the name after the original layers have been removed so we don't + end up with #2 appended to the name */ + drawable_set_name (GIMP_DRAWABLE(merge_layer), name); + g_free(name); + /* End the merge undo group */ undo_push_group_end (gimage); diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index 72f8e68b4e..4034f1c9e1 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage, } /* Don't forget the selection mask! */ + /* if (channel_is_empty(gimage->selection_mask)) + channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + else + */ + channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); @@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage, gint position; gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint off_x, off_y; + char *name; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2706,6 +2712,8 @@ gimp_image_merge_layers (GimpImage *gimage, /* Start a merge undo group */ undo_push_group_start (gimage, LAYER_MERGE_UNDO); + name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer))); + if (merge_type == FLATTEN_IMAGE || drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) { @@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage, * whether or not the original did * Opacity is set to 100% and the MODE is set to normal */ + merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), drawable_type_with_alpha (GIMP_DRAWABLE(layer)), - drawable_get_name (GIMP_DRAWABLE(layer)), + "merged layer", OPAQUE_OPACITY, NORMAL_MODE); + if (!merge_layer) { g_message ("gimp_image_merge_layers: could not allocate merge layer"); @@ -2780,6 +2790,12 @@ gimp_image_merge_layers (GimpImage *gimage, bottom->mode = NORMAL_MODE; } + /* Copy the tattoo and parasites of the bottom layer to the new layer */ + layer_set_tattoo(merge_layer, layer_get_tattoo(layer)); + GIMP_DRAWABLE(merge_layer)->parasites + = parasite_list_copy(GIMP_DRAWABLE(layer)->parasites); + + while (reverse_list) { layer = (Layer *) reverse_list->data; @@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage, (g_slist_length (gimage->layers) - position + 1)); } + /* set the name after the original layers have been removed so we don't + end up with #2 appended to the name */ + drawable_set_name (GIMP_DRAWABLE(merge_layer), name); + g_free(name); + /* End the merge undo group */ undo_push_group_end (gimage); diff --git a/app/gimpimage.c b/app/gimpimage.c index 72f8e68b4e..4034f1c9e1 100644 --- a/app/gimpimage.c +++ b/app/gimpimage.c @@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage, } /* Don't forget the selection mask! */ + /* if (channel_is_empty(gimage->selection_mask)) + channel_resize(gimage->selection_mask, new_width, new_height, 0, 0) + else + */ + channel_scale (gimage->selection_mask, new_width, new_height); gimage_mask_invalidate (gimage); @@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage, gint position; gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint off_x, off_y; + char *name; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); @@ -2706,6 +2712,8 @@ gimp_image_merge_layers (GimpImage *gimage, /* Start a merge undo group */ undo_push_group_start (gimage, LAYER_MERGE_UNDO); + name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer))); + if (merge_type == FLATTEN_IMAGE || drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) { @@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage, * whether or not the original did * Opacity is set to 100% and the MODE is set to normal */ + merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), drawable_type_with_alpha (GIMP_DRAWABLE(layer)), - drawable_get_name (GIMP_DRAWABLE(layer)), + "merged layer", OPAQUE_OPACITY, NORMAL_MODE); + if (!merge_layer) { g_message ("gimp_image_merge_layers: could not allocate merge layer"); @@ -2780,6 +2790,12 @@ gimp_image_merge_layers (GimpImage *gimage, bottom->mode = NORMAL_MODE; } + /* Copy the tattoo and parasites of the bottom layer to the new layer */ + layer_set_tattoo(merge_layer, layer_get_tattoo(layer)); + GIMP_DRAWABLE(merge_layer)->parasites + = parasite_list_copy(GIMP_DRAWABLE(layer)->parasites); + + while (reverse_list) { layer = (Layer *) reverse_list->data; @@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage, (g_slist_length (gimage->layers) - position + 1)); } + /* set the name after the original layers have been removed so we don't + end up with #2 appended to the name */ + drawable_set_name (GIMP_DRAWABLE(merge_layer), name); + g_free(name); + /* End the merge undo group */ undo_push_group_end (gimage);