[gimp/gimp-2-10] app: clip floating selection to layers with no alpha channel



commit ada1a3cf6971d33077e756eb628ee9ea18c5b02d
Author: Ell <ell_se yahoo com>
Date:   Thu Oct 3 22:09:43 2019 +0300

    app: clip floating selection to layers with no alpha channel
    
    Alawys clip a floating selection to its base layer, if the layer
    has no alpha channel.  This avoids arbitrarily filling the extended
    regions of the layer with, or compositing the floating selection
    against, black color.
    
    This is a temporary solution.  Ideally, we'd automatically add an
    alpha channel to the layer as necessary.
    
    (cherry picked from commit 7a8c79e7e75812d683430be163950b68a3d3498a)

 app/core/gimpdrawable-floating-selection.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/app/core/gimpdrawable-floating-selection.c b/app/core/gimpdrawable-floating-selection.c
index 94f9db22c8..71866b1dfe 100644
--- a/app/core/gimpdrawable-floating-selection.c
+++ b/app/core/gimpdrawable-floating-selection.c
@@ -337,7 +337,8 @@ gimp_drawable_sync_fs_filter (GimpDrawable *drawable)
   gimp_item_get_offset (GIMP_ITEM (fs), &fs_off_x, &fs_off_y);
 
   if (gimp_item_get_clip (GIMP_ITEM (drawable), GIMP_TRANSFORM_RESIZE_ADJUST) ==
-      GIMP_TRANSFORM_RESIZE_CLIP)
+      GIMP_TRANSFORM_RESIZE_CLIP ||
+      ! gimp_drawable_has_alpha (drawable))
     {
       gegl_node_set (
         private->fs_crop_node,


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