[gimp] Issue #3124 - layer mask pastes as a greyscale layer/grayscale layer...
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Issue #3124 - layer mask pastes as a greyscale layer/grayscale layer...
- Date: Sat, 25 May 2019 15:10:40 +0000 (UTC)
commit 1f57675a46f71fbb77daf68357362e7bc4ae5902
Author: Michael Natterer <mitch gimp org>
Date: Sat May 25 17:05:49 2019 +0200
Issue #3124 - layer mask pastes as a greyscale layer/grayscale layer...
...in a color image/colour image
gimp_edit_paste_get_layer(): only use the pasted-to drawable's format
with alpha if this is really a floating paste, use the image's layer
format with alpha for "as new layer" cases.
app/core/gimp-edit.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c
index 6a8867ace3..7baca8ae3a 100644
--- a/app/core/gimp-edit.c
+++ b/app/core/gimp-edit.c
@@ -207,6 +207,25 @@ gimp_edit_paste_is_in_place (GimpPasteType paste_type)
g_return_val_if_reached (FALSE);
}
+static gboolean
+gimp_edit_paste_is_floating (GimpPasteType paste_type)
+{
+ switch (paste_type)
+ {
+ case GIMP_PASTE_TYPE_FLOATING:
+ case GIMP_PASTE_TYPE_FLOATING_INTO:
+ case GIMP_PASTE_TYPE_FLOATING_IN_PLACE:
+ case GIMP_PASTE_TYPE_FLOATING_INTO_IN_PLACE:
+ return TRUE;
+
+ case GIMP_PASTE_TYPE_NEW_LAYER:
+ case GIMP_PASTE_TYPE_NEW_LAYER_IN_PLACE:
+ return FALSE;
+ }
+
+ g_return_val_if_reached (FALSE);
+}
+
static GimpLayer *
gimp_edit_paste_get_layer (GimpImage *image,
GimpDrawable *drawable,
@@ -232,7 +251,7 @@ gimp_edit_paste_get_layer (GimpImage *image,
/* floating pastes always have the pasted-to drawable's format with
* alpha; if drawable == NULL, user is pasting into an empty image
*/
- if (drawable)
+ if (drawable && gimp_edit_paste_is_floating (*paste_type))
floating_format = gimp_drawable_get_format_with_alpha (drawable);
else
floating_format = gimp_image_get_layer_format (image, TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]