[gimp/gimp-2-6] Bug 595170 - brush - color from gradient works wrong in greyscale



commit 05f3a559b6e0c2b05f29e64800323d4327f4c6a0
Author: Michael Natterer <mitch gimp org>
Date:   Sun Jun 27 01:55:21 2010 +0200

    Bug 595170 - brush - color from gradient works wrong in greyscale
    
    Convert the gradient color to the drawable's type before using it.
    (manually cherry-picked from 15fd08747de7bfac29dd13550109c58f484bdb7a)

 app/paint/gimppaintbrush.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/app/paint/gimppaintbrush.c b/app/paint/gimppaintbrush.c
index 8b14f3f..e54fea3 100644
--- a/app/paint/gimppaintbrush.c
+++ b/app/paint/gimppaintbrush.c
@@ -137,15 +137,22 @@ _gimp_paintbrush_motion (GimpPaintCore    *paint_core,
                                              paint_core->pixel_dist,
                                              &gradient_color))
     {
+      guchar pixel[MAX_CHANNELS] = { OPAQUE_OPACITY,
+                                     OPAQUE_OPACITY,
+                                     OPAQUE_OPACITY,
+                                     OPAQUE_OPACITY };
+
       opacity *= gradient_color.a;
 
       gimp_rgb_get_uchar (&gradient_color,
                           &col[RED_PIX],
                           &col[GREEN_PIX],
                           &col[BLUE_PIX]);
-      col[ALPHA_PIX] = OPAQUE_OPACITY;
 
-      color_pixels (temp_buf_data (area), col,
+      gimp_image_transform_color (image, gimp_drawable_type (drawable), pixel,
+                                  GIMP_RGB, col);
+
+      color_pixels (temp_buf_data (area), pixel,
                     area->width * area->height,
                     area->bytes);
 



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