better fix for the indexed merge problem

-Yosh
This commit is contained in:
Manish Singh 1998-05-17 22:09:33 +00:00
parent 488c4c9851
commit 5b1f6495d8
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,7 @@
Sun May 17 14:44:32 PDT 1998 Manish Singh <yosh@gimp.org>
* app/gimage.c: fix for merging indexed and indexed-alpha layers
* app/gimage.c: fix for merging indexed and indexed-alpha
layers (from Raph)
Sun May 17 14:02:44 PDT 1998 Manish Singh <yosh@gimp.org>

View File

@ -1950,7 +1950,7 @@ gimage_merge_layers (GImage *gimage, GSList *merge_list, MergeType merge_type)
undo_push_group_start (gimage, LAYER_MERGE_UNDO);
if (merge_type == FlattenImage ||
!layer_has_alpha (layer))
drawable_type (GIMP_DRAWABLE (layer)) == INDEXED_GIMAGE)
{
switch (gimage_base_type (gimage))
{
@ -1958,7 +1958,7 @@ gimage_merge_layers (GImage *gimage, GSList *merge_list, MergeType merge_type)
case GRAY: type = GRAY_GIMAGE; break;
case INDEXED: type = INDEXED_GIMAGE; break;
}
merge_layer = layer_new (gimage->ID, gimage->width, gimage->height,
merge_layer = layer_new (gimage->ID, (x2 - x1), (y2 - y1),
type, drawable_name (GIMP_DRAWABLE(layer)), OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer) {
@ -1966,6 +1966,9 @@ gimage_merge_layers (GImage *gimage, GSList *merge_list, MergeType merge_type)
return NULL;
}
GIMP_DRAWABLE(merge_layer)->offset_x = x1;
GIMP_DRAWABLE(merge_layer)->offset_y = y1;
/* get the background for compositing */
gimage_get_background (gimage, GIMP_DRAWABLE(merge_layer), bg);