[gimp/gimp-2-10] app: in gimp:mask-components, don't forward empty aux when mask is fully set



commit 7f6e522a358c84a5804909d5c0702b8e870aeb77
Author: Ell <ell_se yahoo com>
Date:   Fri Mar 1 14:33:04 2019 -0500

    app: in gimp:mask-components, don't forward empty aux when mask is fully set
    
    ... since the result needs to be fully opaque in this case, rather
    than fully transparent.
    
    (cherry picked from commit 371e35eeb84c195fde6aa397a799582854e00752)

 app/operations/gimpoperationmaskcomponents.cc | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/app/operations/gimpoperationmaskcomponents.cc b/app/operations/gimpoperationmaskcomponents.cc
index d10d11952a..352267376f 100644
--- a/app/operations/gimpoperationmaskcomponents.cc
+++ b/app/operations/gimpoperationmaskcomponents.cc
@@ -406,9 +406,16 @@ gimp_operation_mask_components_parent_process (GeglOperation        *operation,
     {
       GObject *aux = gegl_operation_context_get_object (context, "aux");
 
-      gegl_operation_context_set_object (context, "output", aux);
+      /* when there's no aux and the alpha component is masked-in, we set the
+       * result's alpha component to full opacity, rather than full
+       * transparency, so we can't just forward an empty aux in this case.
+       */
+      if (aux)
+        {
+          gegl_operation_context_set_object (context, "output", aux);
 
-      return TRUE;
+          return TRUE;
+        }
     }
 
   return GEGL_OPERATION_CLASS (parent_class)->process (operation, context,


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