[gimp] app: use paint composite-mode, instead of AUTO, in more places



commit 45be8b259121adc43d1d0199fa545cc621f8b1f3
Author: Ell <ell_se yahoo com>
Date:   Wed Apr 25 11:12:47 2018 -0400

    app: use paint composite-mode, instead of AUTO, in more places
    
    In the various types of fill operations, and in fade operations,
    use the paint composite-mode of the current paint mode, which is
    the composite mode we use during painting, instead of AUTO, which
    results in the default mode we use for layer compositing.  This
    effectively means that filling using any non-legacy, non-
    subtractive mode can paint over transparent areas, rather than
    being limited to nontransparent areas.

 app/core/gimpdrawable-bucket-fill.c |    5 ++++-
 app/core/gimpdrawable-edit.c        |    5 ++++-
 app/core/gimpdrawable-fill.c        |    5 ++++-
 app/core/gimpdrawable-gradient.c    |    4 +++-
 app/core/gimpimage-fade.c           |    5 ++++-
 app/tools/gimpgradienttool.c        |    8 ++++++--
 6 files changed, 25 insertions(+), 7 deletions(-)
---
diff --git a/app/core/gimpdrawable-bucket-fill.c b/app/core/gimpdrawable-bucket-fill.c
index 5396c2e..e0e31b7 100644
--- a/app/core/gimpdrawable-bucket-fill.c
+++ b/app/core/gimpdrawable-bucket-fill.c
@@ -31,6 +31,8 @@
 #include "gegl/gimp-gegl-mask-combine.h"
 #include "gegl/gimp-gegl-utils.h"
 
+#include "operations/layer-modes/gimp-layer-modes.h"
+
 #include "gimp.h"
 #include "gimpchannel.h"
 #include "gimpdrawable.h"
@@ -182,7 +184,8 @@ gimp_drawable_bucket_fill (GimpDrawable         *drawable,
                               gimp_context_get_paint_mode (GIMP_CONTEXT (options)),
                               GIMP_LAYER_COLOR_SPACE_AUTO,
                               GIMP_LAYER_COLOR_SPACE_AUTO,
-                              GIMP_LAYER_COMPOSITE_AUTO,
+                              gimp_layer_mode_get_paint_composite_mode (
+                                gimp_context_get_paint_mode (GIMP_CONTEXT (options))),
                               NULL, x, y);
 
   g_object_unref (buffer);
diff --git a/app/core/gimpdrawable-edit.c b/app/core/gimpdrawable-edit.c
index c3073ac..8fec3b6 100644
--- a/app/core/gimpdrawable-edit.c
+++ b/app/core/gimpdrawable-edit.c
@@ -22,6 +22,8 @@
 
 #include "core-types.h"
 
+#include "operations/layer-modes/gimp-layer-modes.h"
+
 #include "gimpdrawable.h"
 #include "gimpdrawable-edit.h"
 #include "gimpcontext.h"
@@ -85,7 +87,8 @@ gimp_drawable_edit_fill (GimpDrawable    *drawable,
                               gimp_context_get_paint_mode (GIMP_CONTEXT (options)),
                               GIMP_LAYER_COLOR_SPACE_AUTO,
                               GIMP_LAYER_COLOR_SPACE_AUTO,
-                              GIMP_LAYER_COMPOSITE_AUTO,
+                              gimp_layer_mode_get_paint_composite_mode (
+                                gimp_context_get_paint_mode (GIMP_CONTEXT (options))),
                               NULL, x, y);
 
   g_object_unref (buffer);
diff --git a/app/core/gimpdrawable-fill.c b/app/core/gimpdrawable-fill.c
index 0921aea..7fedbfe 100644
--- a/app/core/gimpdrawable-fill.c
+++ b/app/core/gimpdrawable-fill.c
@@ -30,6 +30,8 @@
 #include "gegl/gimp-gegl-loops.h"
 #include "gegl/gimp-gegl-utils.h"
 
+#include "operations/layer-modes/gimp-layer-modes.h"
+
 #include "gimp-utils.h"
 #include "gimpbezierdesc.h"
 #include "gimpchannel.h"
@@ -258,7 +260,8 @@ gimp_drawable_fill_scan_convert (GimpDrawable    *drawable,
                               gimp_context_get_paint_mode (context),
                               GIMP_LAYER_COLOR_SPACE_AUTO,
                               GIMP_LAYER_COLOR_SPACE_AUTO,
-                              GIMP_LAYER_COMPOSITE_AUTO,
+                              gimp_layer_mode_get_paint_composite_mode (
+                                gimp_context_get_paint_mode (context)),
                               NULL, x, y);
 
   g_object_unref (buffer);
diff --git a/app/core/gimpdrawable-gradient.c b/app/core/gimpdrawable-gradient.c
index 8d56997..5865ee6 100644
--- a/app/core/gimpdrawable-gradient.c
+++ b/app/core/gimpdrawable-gradient.c
@@ -26,6 +26,8 @@
 #include "gegl/gimp-gegl-apply-operation.h"
 #include "gegl/gimp-gegl-utils.h"
 
+#include "operations/layer-modes/gimp-layer-modes.h"
+
 #include "gimp.h"
 #include "gimpchannel.h"
 #include "gimpcontext.h"
@@ -137,7 +139,7 @@ gimp_drawable_gradient (GimpDrawable                *drawable,
                               opacity, paint_mode,
                               GIMP_LAYER_COLOR_SPACE_AUTO,
                               GIMP_LAYER_COLOR_SPACE_AUTO,
-                              GIMP_LAYER_COMPOSITE_AUTO,
+                              gimp_layer_mode_get_paint_composite_mode (paint_mode),
                               NULL, x, y);
 
   gimp_drawable_update (drawable, x, y, width, height);
diff --git a/app/core/gimpimage-fade.c b/app/core/gimpimage-fade.c
index 52ccf62..7b625bd 100644
--- a/app/core/gimpimage-fade.c
+++ b/app/core/gimpimage-fade.c
@@ -22,6 +22,8 @@
 
 #include "core-types.h"
 
+#include "operations/layer-modes/gimp-layer-modes.h"
+
 #include "gimpcontext.h"
 #include "gimpdrawable.h"
 #include "gimpdrawableundo.h"
@@ -65,7 +67,8 @@ gimp_image_fade (GimpImage   *image,
                                   gimp_context_get_paint_mode (context),
                                   GIMP_LAYER_COLOR_SPACE_AUTO,
                                   GIMP_LAYER_COLOR_SPACE_AUTO,
-                                  GIMP_LAYER_COMPOSITE_AUTO,
+                                  gimp_layer_mode_get_paint_composite_mode (
+                                    gimp_context_get_paint_mode (context)),
                                   NULL, undo->x, undo->y);
 
       g_object_unref (buffer);
diff --git a/app/tools/gimpgradienttool.c b/app/tools/gimpgradienttool.c
index d4278aa..ee6b5ce 100644
--- a/app/tools/gimpgradienttool.c
+++ b/app/tools/gimpgradienttool.c
@@ -30,6 +30,8 @@
 
 #include "operations/gimp-operation-config.h"
 
+#include "operations/layer-modes/gimp-layer-modes.h"
+
 #include "core/gimpdrawable.h"
 #include "core/gimpdrawable-gradient.h"
 #include "core/gimpdrawablefilter.h"
@@ -575,7 +577,8 @@ gimp_gradient_tool_options_notify (GimpTool         *tool,
                                      gimp_context_get_paint_mode (context),
                                      GIMP_LAYER_COLOR_SPACE_AUTO,
                                      GIMP_LAYER_COLOR_SPACE_AUTO,
-                                     GIMP_LAYER_COMPOSITE_AUTO);
+                                     gimp_layer_mode_get_paint_composite_mode (
+                                       gimp_context_get_paint_mode (context)));
     }
 
   gimp_gradient_tool_editor_options_notify (gradient_tool, options, pspec);
@@ -1048,7 +1051,8 @@ gimp_gradient_tool_create_filter (GimpGradientTool *gradient_tool,
                                  gimp_context_get_paint_mode (context),
                                  GIMP_LAYER_COLOR_SPACE_AUTO,
                                  GIMP_LAYER_COLOR_SPACE_AUTO,
-                                 GIMP_LAYER_COMPOSITE_AUTO);
+                                 gimp_layer_mode_get_paint_composite_mode (
+                                   gimp_context_get_paint_mode (context)));
 
   g_signal_connect (gradient_tool->filter, "flush",
                     G_CALLBACK (gimp_gradient_tool_filter_flush),


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