[gimp] Bug 770171 - Mypaint eraser won't work unless there is an alpha channel



commit f40e36ffabefa30abcf36b71fe2ee73312631962
Author: Michael Natterer <mitch gimp org>
Date:   Sat Sep 3 15:48:02 2016 +0200

    Bug 770171 - Mypaint eraser won't work unless there is an alpha channel
    
    In eraser mode, paint with the background color on layers without alpha.

 app/paint/gimpmybrushcore.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/app/paint/gimpmybrushcore.c b/app/paint/gimpmybrushcore.c
index 586e311..e180479 100644
--- a/app/paint/gimpmybrushcore.c
+++ b/app/paint/gimpmybrushcore.c
@@ -360,7 +360,11 @@ gimp_mybrush_core_create_brushes (GimpMybrushCore  *mybrush,
       mybrush->private->brushes = NULL;
     }
 
-  gimp_context_get_foreground (context, &fg);
+  if (options->eraser)
+    gimp_context_get_background (context, &fg);
+  else
+    gimp_context_get_foreground (context, &fg);
+
   gimp_pickable_srgb_to_image_color (GIMP_PICKABLE (drawable),
                                      &fg, &fg);
   gimp_rgb_to_hsv (&fg, &hsv);
@@ -399,7 +403,9 @@ gimp_mybrush_core_create_brushes (GimpMybrushCore  *mybrush,
                                     options->hardness);
       mypaint_brush_set_base_value (brush,
                                     MYPAINT_BRUSH_SETTING_ERASER,
-                                    options->eraser ? 1.0f : 0.0f);
+                                    (options->eraser &&
+                                     gimp_drawable_has_alpha (drawable)) ?
+                                    1.0f : 0.0f);
 
       mypaint_brush_new_stroke (brush);
 


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