[gimp] Bug 646718 - gimp_curve_set_curve: assertion `y >= 0 && y <= 1.0' failed



commit 5562f840b61cb86ad4e4a937df7fb956357287bb
Author: Michael Natterer <mitch gimp org>
Date:   Fri Apr 8 20:53:17 2011 +0200

    Bug 646718 - gimp_curve_set_curve: assertion `y >= 0 && y <= 1.0' failed
    
    CLAMP(value, 0.0, 1.0) in one more place. The calculation does
    look correct, but we are probably running into floating point
    inaccuracies.

 app/widgets/gimpcurveview.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpcurveview.c b/app/widgets/gimpcurveview.c
index 1762fef..e2c6e85 100644
--- a/app/widgets/gimpcurveview.c
+++ b/app/widgets/gimpcurveview.c
@@ -888,6 +888,9 @@ gimp_curve_view_motion_notify (GtkWidget      *widget,
                   gdouble xpos = (gdouble) i / (gdouble) (n_samples - 1);
                   gdouble ypos = (y1 + ((y2 - y1) * (xpos - x1)) / (x2 - x1));
 
+                  xpos = CLAMP (xpos, 0.0, 1.0);
+                  ypos = CLAMP (ypos, 0.0, 1.0);
+
                   gimp_curve_set_curve (curve, xpos, 1.0 - ypos);
                 }
 



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