Copy the name, tatto and parasites of the bottom layer to the new merged

* app/gimpimage.c: Copy the name, tatto and parasites of the
	bottom layer to the new merged layer in gimp_image_merge_layers.
This commit is contained in:
jaycox 2000-05-12 01:14:21 +00:00
parent f28e922c2e
commit e2b3381917
9 changed files with 181 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2000-05-12 Jay Cox <jaycox@earthlink.net>
* 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 <tml@iki.fi> 2000-05-11 Tor Lillqvist <tml@iki.fi>
* PLUGIN_MAINTAINERS * PLUGIN_MAINTAINERS

View File

@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* 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); channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage,
gint position; gint position;
gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint active[MAX_CHANNELS] = {1, 1, 1, 1};
gint off_x, off_y; gint off_x, off_y;
char *name;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); 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 */ /* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO); undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer)));
if (merge_type == FLATTEN_IMAGE || if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
{ {
@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage,
* whether or not the original did * whether or not the original did
* Opacity is set to 100% and the MODE is set to normal * Opacity is set to 100% and the MODE is set to normal
*/ */
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
drawable_type_with_alpha (GIMP_DRAWABLE(layer)), drawable_type_with_alpha (GIMP_DRAWABLE(layer)),
drawable_get_name (GIMP_DRAWABLE(layer)), "merged layer",
OPAQUE_OPACITY, NORMAL_MODE); OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer) if (!merge_layer)
{ {
g_message ("gimp_image_merge_layers: could not allocate 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; 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) while (reverse_list)
{ {
layer = (Layer *) reverse_list->data; layer = (Layer *) reverse_list->data;
@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage,
(g_slist_length (gimage->layers) - position + 1)); (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 */ /* End the merge undo group */
undo_push_group_end (gimage); undo_push_group_end (gimage);

View File

@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* 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); channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage,
gint position; gint position;
gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint active[MAX_CHANNELS] = {1, 1, 1, 1};
gint off_x, off_y; gint off_x, off_y;
char *name;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); 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 */ /* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO); undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer)));
if (merge_type == FLATTEN_IMAGE || if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
{ {
@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage,
* whether or not the original did * whether or not the original did
* Opacity is set to 100% and the MODE is set to normal * Opacity is set to 100% and the MODE is set to normal
*/ */
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
drawable_type_with_alpha (GIMP_DRAWABLE(layer)), drawable_type_with_alpha (GIMP_DRAWABLE(layer)),
drawable_get_name (GIMP_DRAWABLE(layer)), "merged layer",
OPAQUE_OPACITY, NORMAL_MODE); OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer) if (!merge_layer)
{ {
g_message ("gimp_image_merge_layers: could not allocate 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; 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) while (reverse_list)
{ {
layer = (Layer *) reverse_list->data; layer = (Layer *) reverse_list->data;
@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage,
(g_slist_length (gimage->layers) - position + 1)); (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 */ /* End the merge undo group */
undo_push_group_end (gimage); undo_push_group_end (gimage);

View File

@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* 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); channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage,
gint position; gint position;
gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint active[MAX_CHANNELS] = {1, 1, 1, 1};
gint off_x, off_y; gint off_x, off_y;
char *name;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); 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 */ /* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO); undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer)));
if (merge_type == FLATTEN_IMAGE || if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
{ {
@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage,
* whether or not the original did * whether or not the original did
* Opacity is set to 100% and the MODE is set to normal * Opacity is set to 100% and the MODE is set to normal
*/ */
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
drawable_type_with_alpha (GIMP_DRAWABLE(layer)), drawable_type_with_alpha (GIMP_DRAWABLE(layer)),
drawable_get_name (GIMP_DRAWABLE(layer)), "merged layer",
OPAQUE_OPACITY, NORMAL_MODE); OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer) if (!merge_layer)
{ {
g_message ("gimp_image_merge_layers: could not allocate 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; 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) while (reverse_list)
{ {
layer = (Layer *) reverse_list->data; layer = (Layer *) reverse_list->data;
@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage,
(g_slist_length (gimage->layers) - position + 1)); (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 */ /* End the merge undo group */
undo_push_group_end (gimage); undo_push_group_end (gimage);

View File

@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* 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); channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage,
gint position; gint position;
gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint active[MAX_CHANNELS] = {1, 1, 1, 1};
gint off_x, off_y; gint off_x, off_y;
char *name;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); 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 */ /* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO); undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer)));
if (merge_type == FLATTEN_IMAGE || if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
{ {
@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage,
* whether or not the original did * whether or not the original did
* Opacity is set to 100% and the MODE is set to normal * Opacity is set to 100% and the MODE is set to normal
*/ */
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
drawable_type_with_alpha (GIMP_DRAWABLE(layer)), drawable_type_with_alpha (GIMP_DRAWABLE(layer)),
drawable_get_name (GIMP_DRAWABLE(layer)), "merged layer",
OPAQUE_OPACITY, NORMAL_MODE); OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer) if (!merge_layer)
{ {
g_message ("gimp_image_merge_layers: could not allocate 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; 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) while (reverse_list)
{ {
layer = (Layer *) reverse_list->data; layer = (Layer *) reverse_list->data;
@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage,
(g_slist_length (gimage->layers) - position + 1)); (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 */ /* End the merge undo group */
undo_push_group_end (gimage); undo_push_group_end (gimage);

View File

@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* 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); channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage,
gint position; gint position;
gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint active[MAX_CHANNELS] = {1, 1, 1, 1};
gint off_x, off_y; gint off_x, off_y;
char *name;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); 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 */ /* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO); undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer)));
if (merge_type == FLATTEN_IMAGE || if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
{ {
@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage,
* whether or not the original did * whether or not the original did
* Opacity is set to 100% and the MODE is set to normal * Opacity is set to 100% and the MODE is set to normal
*/ */
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
drawable_type_with_alpha (GIMP_DRAWABLE(layer)), drawable_type_with_alpha (GIMP_DRAWABLE(layer)),
drawable_get_name (GIMP_DRAWABLE(layer)), "merged layer",
OPAQUE_OPACITY, NORMAL_MODE); OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer) if (!merge_layer)
{ {
g_message ("gimp_image_merge_layers: could not allocate 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; 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) while (reverse_list)
{ {
layer = (Layer *) reverse_list->data; layer = (Layer *) reverse_list->data;
@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage,
(g_slist_length (gimage->layers) - position + 1)); (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 */ /* End the merge undo group */
undo_push_group_end (gimage); undo_push_group_end (gimage);

View File

@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* 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); channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage,
gint position; gint position;
gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint active[MAX_CHANNELS] = {1, 1, 1, 1};
gint off_x, off_y; gint off_x, off_y;
char *name;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); 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 */ /* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO); undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer)));
if (merge_type == FLATTEN_IMAGE || if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
{ {
@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage,
* whether or not the original did * whether or not the original did
* Opacity is set to 100% and the MODE is set to normal * Opacity is set to 100% and the MODE is set to normal
*/ */
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
drawable_type_with_alpha (GIMP_DRAWABLE(layer)), drawable_type_with_alpha (GIMP_DRAWABLE(layer)),
drawable_get_name (GIMP_DRAWABLE(layer)), "merged layer",
OPAQUE_OPACITY, NORMAL_MODE); OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer) if (!merge_layer)
{ {
g_message ("gimp_image_merge_layers: could not allocate 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; 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) while (reverse_list)
{ {
layer = (Layer *) reverse_list->data; layer = (Layer *) reverse_list->data;
@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage,
(g_slist_length (gimage->layers) - position + 1)); (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 */ /* End the merge undo group */
undo_push_group_end (gimage); undo_push_group_end (gimage);

View File

@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* 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); channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage,
gint position; gint position;
gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint active[MAX_CHANNELS] = {1, 1, 1, 1};
gint off_x, off_y; gint off_x, off_y;
char *name;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); 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 */ /* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO); undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer)));
if (merge_type == FLATTEN_IMAGE || if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
{ {
@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage,
* whether or not the original did * whether or not the original did
* Opacity is set to 100% and the MODE is set to normal * Opacity is set to 100% and the MODE is set to normal
*/ */
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
drawable_type_with_alpha (GIMP_DRAWABLE(layer)), drawable_type_with_alpha (GIMP_DRAWABLE(layer)),
drawable_get_name (GIMP_DRAWABLE(layer)), "merged layer",
OPAQUE_OPACITY, NORMAL_MODE); OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer) if (!merge_layer)
{ {
g_message ("gimp_image_merge_layers: could not allocate 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; 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) while (reverse_list)
{ {
layer = (Layer *) reverse_list->data; layer = (Layer *) reverse_list->data;
@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage,
(g_slist_length (gimage->layers) - position + 1)); (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 */ /* End the merge undo group */
undo_push_group_end (gimage); undo_push_group_end (gimage);

View File

@ -578,6 +578,11 @@ gimp_image_scale (GimpImage *gimage,
} }
/* Don't forget the selection mask! */ /* 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); channel_scale (gimage->selection_mask, new_width, new_height);
gimage_mask_invalidate (gimage); gimage_mask_invalidate (gimage);
@ -2629,6 +2634,7 @@ gimp_image_merge_layers (GimpImage *gimage,
gint position; gint position;
gint active[MAX_CHANNELS] = {1, 1, 1, 1}; gint active[MAX_CHANNELS] = {1, 1, 1, 1};
gint off_x, off_y; gint off_x, off_y;
char *name;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); 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 */ /* Start a merge undo group */
undo_push_group_start (gimage, LAYER_MERGE_UNDO); undo_push_group_start (gimage, LAYER_MERGE_UNDO);
name = g_strdup(drawable_get_name (GIMP_DRAWABLE(layer)));
if (merge_type == FLATTEN_IMAGE || if (merge_type == FLATTEN_IMAGE ||
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE) drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
{ {
@ -2745,10 +2753,12 @@ gimp_image_merge_layers (GimpImage *gimage,
* whether or not the original did * whether or not the original did
* Opacity is set to 100% and the MODE is set to normal * Opacity is set to 100% and the MODE is set to normal
*/ */
merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1), merge_layer = layer_new (gimage, (x2 - x1), (y2 - y1),
drawable_type_with_alpha (GIMP_DRAWABLE(layer)), drawable_type_with_alpha (GIMP_DRAWABLE(layer)),
drawable_get_name (GIMP_DRAWABLE(layer)), "merged layer",
OPAQUE_OPACITY, NORMAL_MODE); OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer) if (!merge_layer)
{ {
g_message ("gimp_image_merge_layers: could not allocate 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; 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) while (reverse_list)
{ {
layer = (Layer *) reverse_list->data; layer = (Layer *) reverse_list->data;
@ -2847,6 +2863,11 @@ gimp_image_merge_layers (GimpImage *gimage,
(g_slist_length (gimage->layers) - position + 1)); (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 */ /* End the merge undo group */
undo_push_group_end (gimage); undo_push_group_end (gimage);