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.
This commit is contained in:
Michael Natterer 2011-04-08 20:53:17 +02:00
parent 8c4d99f883
commit 5562f840b6
1 changed files with 3 additions and 0 deletions

View File

@ -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);
}