[gimp] app: fix rendering of the bg_histogram in GimpHistogramView



commit 1950eda8abb5f13cfb32268c93ca8bd6ceefc587
Author: Michael Natterer <mitch gimp org>
Date:   Mon May 7 10:17:19 2018 +0200

    app: fix rendering of the bg_histogram in GimpHistogramView
    
    gimp_histogram_view_draw_spike(): we were shifting the bg_histogram to
    the right by accidentially offsetting the 'i' variable, use a local
    variable for the loop instead.

 app/widgets/gimphistogramview.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/app/widgets/gimphistogramview.c b/app/widgets/gimphistogramview.c
index a9f7579..80c27e6 100644
--- a/app/widgets/gimphistogramview.c
+++ b/app/widgets/gimphistogramview.c
@@ -451,26 +451,32 @@ gimp_histogram_view_draw_spike (GimpHistogramView    *view,
 
   if (view->histogram)
     {
+      gint ii = i;
+
       do
         {
-          gdouble v = gimp_histogram_get_value (view->histogram, channel, i++);
+          gdouble v = gimp_histogram_get_value (view->histogram,
+                                                channel, ii++);
 
           if (v > value)
             value = v;
         }
-      while (i < j);
+      while (ii < j);
     }
 
   if (bg_color && view->bg_histogram)
     {
+      gint ii = i;
+
       do
         {
-          gdouble v = gimp_histogram_get_value (view->bg_histogram, channel, i++);
+          gdouble v = gimp_histogram_get_value (view->bg_histogram,
+                                                channel, ii++);
 
           if (v > bg_value)
             bg_value = v;
         }
-      while (i < j);
+      while (ii < j);
     }
 
   if (value <= 0.0 && bg_value <= 0.0)


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