[gimp] app: Correctly place merged down layer...



commit 8516221662c43da5855f396c2febc1f91701ebfa
Author: Stanislav Grinkov <43956-stanislavgrinkov users noreply gitlab gnome org>
Date:   Wed Aug 11 00:43:20 2021 +0600

    app: Correctly place merged down layer...
    
    when the image is in indexed color mode, and bottom layer doesn't
    have an alpha channel.
    
    Resolves: #4945

 app/core/gimpimage-merge.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c
index f63e315fcc..fa94a996f7 100644
--- a/app/core/gimpimage-merge.c
+++ b/app/core/gimpimage-merge.c
@@ -692,8 +692,6 @@ gimp_image_merge_layers (GimpImage     *image,
         (&bg,
          gimp_drawable_get_space (GIMP_DRAWABLE (layer)),
          gimp_layer_get_real_composite_space (bottom_layer));
-
-      position = 0;
     }
   else
     {
@@ -715,7 +713,14 @@ gimp_image_merge_layers (GimpImage     *image,
 
           return NULL;
         }
+    }
 
+  if (merge_type == GIMP_FLATTEN_IMAGE)
+    {
+      position = 0;
+    }
+  else
+    {
       /*  Find the index in the layer list of the bottom layer--we need this
        *  in order to add the final, merged layer to the layer list correctly
        */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]