[gimp/metadata-browser] app: gimp_edit_paste(): use more formats inatead of GimpImageType
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] app: gimp_edit_paste(): use more formats inatead of GimpImageType
- Date: Wed, 12 Sep 2012 23:44:44 +0000 (UTC)
commit 8965e3a319623de08c2364ebb6b2fb63d65d0925
Author: Michael Natterer <mitch gimp org>
Date: Fri Apr 6 23:37:35 2012 +0200
app: gimp_edit_paste(): use more formats inatead of GimpImageType
app/core/gimp-edit.c | 30 +++++++++++++++++++-----------
1 files changed, 19 insertions(+), 11 deletions(-)
---
diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c
index 3dbff1e..1e571c7 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]