From f4d8e5266a73cc1bbf8690ab6c72472abeb8c954 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 6 Apr 2012 23:37:35 +0200 Subject: [PATCH] app: gimp_edit_paste(): use more formats inatead of GimpImageType --- app/core/gimp-edit.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c index 3dbff1ebe4..1e571c74f3 100644 --- a/app/core/gimp-edit.c +++ b/app/core/gimp-edit.c @@ -154,14 +154,14 @@ gimp_edit_paste (GimpImage *image, gint viewport_width, gint viewport_height) { - GimpLayer *layer; - GimpImageType type; - gint center_x; - gint center_y; - gint offset_x; - gint offset_y; - gint width; - gint height; + GimpLayer *layer; + const Babl *format; + gint center_x; + gint center_y; + gint offset_x; + gint offset_y; + gint width; + gint height; g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (drawable == NULL || GIMP_IS_DRAWABLE (drawable), NULL); @@ -174,13 +174,21 @@ gimp_edit_paste (GimpImage *image, */ if (drawable) - type = gimp_drawable_type_with_alpha (drawable); + { + format = gimp_drawable_get_format_with_alpha (drawable); + } else - type = gimp_image_base_type_with_alpha (image); + { + GimpImageType type; + + type = gimp_image_base_type_with_alpha (image); + + format = gimp_image_get_format (image, type); + } layer = gimp_layer_new_from_buffer (gimp_buffer_get_buffer (paste), image, - gimp_image_get_format (image, type), + format, _("Pasted Layer"), GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE);