Commit 97b8f510 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

when saving a curve of type GIMP_CURVE_FREE, don't use

2008-10-09  Michael Natterer  <mitch@gimp.org>

	* app/gegl/gimpcurvesconfig.c (gimp_curves_config_save_cruft):
	when saving a curve of type GIMP_CURVE_FREE, don't use
	gimp_curve_get_point() because that returns nothing for free
	curves.

	(gimp_curves_config_load_cruft): reset the curve before loading it.

	* app/core/gimpcurve.c (gimp_curve_get_point): instead of above
	mentioned uninitialized nonsense, at least return -1,-1 for free
	curves.


svn path=/trunk/; revision=27190
parent fafec130
2008-10-09 Michael Natterer <mitch@gimp.org>
* app/gegl/gimpcurvesconfig.c (gimp_curves_config_save_cruft):
when saving a curve of type GIMP_CURVE_FREE, don't use
gimp_curve_get_point() because that returns nothing for free
curves.
(gimp_curves_config_load_cruft): reset the curve before loading it.
* app/core/gimpcurve.c (gimp_curve_get_point): instead of above
mentioned uninitialized nonsense, at least return -1,-1 for free
curves.
2008-10-09 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
......
......@@ -809,7 +809,12 @@ gimp_curve_get_point (GimpCurve *curve,
g_return_if_fail (point >= 0 && point < curve->n_points);
if (curve->curve_type == GIMP_CURVE_FREE)
return;
{
if (x) *x = -1.0;
if (y) *y = -1.0;
return;
}
if (x) *x = curve->points[point].x;
if (y) *y = curve->points[point].y;
......
......@@ -411,10 +411,12 @@ gimp_curves_config_load_cruft (GimpCurvesConfig *config,
gimp_curve_set_curve_type (curve, GIMP_CURVE_SMOOTH);
gimp_curve_reset (curve, FALSE);
for (j = 0; j < GIMP_CURVE_N_CRUFT_POINTS; j++)
{
if (index[i][j] < 0 || value[i][j] < 0)
gimp_curve_set_point (curve, j, -1, -1);
gimp_curve_set_point (curve, j, -1.0, -1.0);
else
gimp_curve_set_point (curve, j,
(gdouble) index[i][j] / 255.0,
......@@ -476,9 +478,11 @@ gimp_curves_config_save_cruft (GimpCurvesConfig *config,
for (j = 0; j < curve->n_points; j++)
{
gdouble x, y;
gimp_curve_get_point (curve, j, &x, &y);
/* don't use gimp_curve_get_point() becaue that doesn't
* work when the curve type is GIMP_CURVE_FREE
*/
gdouble x = curve->points[j].x;
gdouble y = curve->points[j].y;
if (x < 0.0 || y < 0.0)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment