gimp r27190 - in trunk: . app/core app/gegl



Author: mitch
Date: Thu Oct  9 09:44:08 2008
New Revision: 27190
URL: http://svn.gnome.org/viewvc/gimp?rev=27190&view=rev

Log:
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.



Modified:
   trunk/ChangeLog
   trunk/app/core/gimpcurve.c
   trunk/app/gegl/gimpcurvesconfig.c

Modified: trunk/app/core/gimpcurve.c
==============================================================================
--- trunk/app/core/gimpcurve.c	(original)
+++ trunk/app/core/gimpcurve.c	Thu Oct  9 09:44:08 2008
@@ -809,7 +809,12 @@
   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;

Modified: trunk/app/gegl/gimpcurvesconfig.c
==============================================================================
--- trunk/app/gegl/gimpcurvesconfig.c	(original)
+++ trunk/app/gegl/gimpcurvesconfig.c	Thu Oct  9 09:44:08 2008
@@ -411,10 +411,12 @@
 
       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 @@
 
       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)
             {



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