diff --git a/ChangeLog b/ChangeLog index a5ba3028c8..3f5e571d3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-01-16 Garry R. Osgood + * app/global_edit.c + global_edit.c Uncovered buglet spawned by #5045 fix. + edit_paste() now properly supplies a GimpImageType + parameter in the case where a GimpImage parameter has no + active_drawable: occurs when the user invokes a + paste into an empty image. + Sat Jan 15 22:27:56 CET 2000 Marc Lehmann * libgimp/gimpenv.c, libgimp/color_selector.h, diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c index 54b0a37cf1..0f322f8b66 100644 --- a/app/core/gimp-edit.c +++ b/app/core/gimp-edit.c @@ -285,10 +285,15 @@ edit_paste (GImage *gimage, int x1, y1, x2, y2; int cx, cy; - /* Make a new layer */ - layer = layer_new_from_tiles (gimage, gimp_drawable_type_with_alpha(drawable), paste, - _("Pasted Layer"), OPAQUE_OPACITY, NORMAL_MODE); + /* Make a new layer: iff drawable == NULL, user is pasting into an empty display. */ + if(drawable != NULL) + layer = layer_new_from_tiles (gimage, gimp_drawable_type_with_alpha(drawable), paste, + _("Pasted Layer"), OPAQUE_OPACITY, NORMAL_MODE); + else + layer = layer_new_from_tiles (gimage, gimp_image_base_type_with_alpha (gimage), paste, + _("Pasted Layer"), OPAQUE_OPACITY, NORMAL_MODE); + if (layer) { /* Start a group undo */ @@ -337,6 +342,7 @@ edit_paste (GImage *gimage, else return NULL; } + int edit_paste_as_new (GImage *invoke, diff --git a/app/core/gimpedit.c b/app/core/gimpedit.c index 54b0a37cf1..0f322f8b66 100644 --- a/app/core/gimpedit.c +++ b/app/core/gimpedit.c @@ -285,10 +285,15 @@ edit_paste (GImage *gimage, int x1, y1, x2, y2; int cx, cy; - /* Make a new layer */ - layer = layer_new_from_tiles (gimage, gimp_drawable_type_with_alpha(drawable), paste, - _("Pasted Layer"), OPAQUE_OPACITY, NORMAL_MODE); + /* Make a new layer: iff drawable == NULL, user is pasting into an empty display. */ + if(drawable != NULL) + layer = layer_new_from_tiles (gimage, gimp_drawable_type_with_alpha(drawable), paste, + _("Pasted Layer"), OPAQUE_OPACITY, NORMAL_MODE); + else + layer = layer_new_from_tiles (gimage, gimp_image_base_type_with_alpha (gimage), paste, + _("Pasted Layer"), OPAQUE_OPACITY, NORMAL_MODE); + if (layer) { /* Start a group undo */ @@ -337,6 +342,7 @@ edit_paste (GImage *gimage, else return NULL; } + int edit_paste_as_new (GImage *invoke, diff --git a/app/global_edit.c b/app/global_edit.c index 54b0a37cf1..0f322f8b66 100644 --- a/app/global_edit.c +++ b/app/global_edit.c @@ -285,10 +285,15 @@ edit_paste (GImage *gimage, int x1, y1, x2, y2; int cx, cy; - /* Make a new layer */ - layer = layer_new_from_tiles (gimage, gimp_drawable_type_with_alpha(drawable), paste, - _("Pasted Layer"), OPAQUE_OPACITY, NORMAL_MODE); + /* Make a new layer: iff drawable == NULL, user is pasting into an empty display. */ + if(drawable != NULL) + layer = layer_new_from_tiles (gimage, gimp_drawable_type_with_alpha(drawable), paste, + _("Pasted Layer"), OPAQUE_OPACITY, NORMAL_MODE); + else + layer = layer_new_from_tiles (gimage, gimp_image_base_type_with_alpha (gimage), paste, + _("Pasted Layer"), OPAQUE_OPACITY, NORMAL_MODE); + if (layer) { /* Start a group undo */ @@ -337,6 +342,7 @@ edit_paste (GImage *gimage, else return NULL; } + int edit_paste_as_new (GImage *invoke,