[gimp/soc-2010-cage] Bug 595170 - brush - color from gradient works wrong in greyscale



commit a06c2d96379081edffe28ac12443be55dfeb28de
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.

 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 0bfcecc..28bd385 100644
--- a/app/paint/gimppaintbrush.c
+++ b/app/paint/gimppaintbrush.c
@@ -151,15 +151,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],
                           &col[GREEN],
                           &col[BLUE]);
-      col[ALPHA] = OPAQUE_OPACITY;
 
-      color_pixels (temp_buf_get_data (area), col,
+      gimp_image_transform_color (image, gimp_drawable_type (drawable), pixel,
+                                  GIMP_RGB, col);
+
+      color_pixels (temp_buf_get_data (area), pixel,
                     area->width * area->height,
                     area->bytes);
 



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