[gimp] Issue #1668 -- Smudge Tool - Wrong colors when painting on an image ...



commit 5a07876c78eb46a22899ecab0eeff53ae4536acd
Author: Ell <ell_se yahoo com>
Date:   Sun Jun 17 14:14:21 2018 -0400

    Issue #1668 -- Smudge Tool - Wrong colors when painting on an image ...
    
    ... with a color profile other than the gimp built-in.
    
    When initializing the smude tool's accum buffer, use
    gimp_pickable_get_pixel_at(), instead of
    gimp_pickable_get_color_at(), for picking the initial color to fill
    the buffer with, so that we don't erroneously apply the image's
    color tranform to it when the image has a profile.  Previously,
    this would result in wrong colors when painting from the drawable
    edges inward, with flow < 100%.

 app/paint/gimpsmudge.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/app/paint/gimpsmudge.c b/app/paint/gimpsmudge.c
index a6f939578e..b8e108e4b3 100644
--- a/app/paint/gimpsmudge.c
+++ b/app/paint/gimpsmudge.c
@@ -260,19 +260,21 @@ gimp_smudge_start (GimpPaintCore    *paint_core,
           accum_size != gegl_buffer_get_width  (paint_buffer) ||
           accum_size != gegl_buffer_get_height (paint_buffer))
         {
-          GimpRGB    pixel;
+          gfloat     pixel[4];
           GeglColor *color;
 
-          gimp_pickable_get_color_at (GIMP_PICKABLE (drawable),
+          gimp_pickable_get_pixel_at (GIMP_PICKABLE (drawable),
                                       CLAMP ((gint) coords->x,
                                              0,
                                              gimp_item_get_width (GIMP_ITEM (drawable)) - 1),
                                       CLAMP ((gint) coords->y,
                                              0,
                                              gimp_item_get_height (GIMP_ITEM (drawable)) - 1),
-                                      &pixel);
+                                      babl_format ("RGBA float"),
+                                      pixel);
 
-          color = gimp_gegl_color_new (&pixel);
+          color = gegl_color_new (NULL);
+          gegl_color_set_pixel (color, babl_format ("RGBA float"), pixel);
           gegl_buffer_set_color (accum_buffer, NULL, color);
           g_object_unref (color);
         }


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