gimp r27191 - in branches/gimp-2-6: . app/core app/gegl
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27191 - in branches/gimp-2-6: . app/core app/gegl
- Date: Thu, 9 Oct 2008 09:44:56 +0000 (UTC)
Author: mitch
Date: Thu Oct 9 09:44:56 2008
New Revision: 27191
URL: http://svn.gnome.org/viewvc/gimp?rev=27191&view=rev
Log:
2008-10-09 Michael Natterer <mitch gimp org>
Merged from trunk:
* 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:
branches/gimp-2-6/ChangeLog
branches/gimp-2-6/app/core/gimpcurve.c
branches/gimp-2-6/app/gegl/gimpcurvesconfig.c
Modified: branches/gimp-2-6/app/core/gimpcurve.c
==============================================================================
--- branches/gimp-2-6/app/core/gimpcurve.c (original)
+++ branches/gimp-2-6/app/core/gimpcurve.c Thu Oct 9 09:44:56 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: branches/gimp-2-6/app/gegl/gimpcurvesconfig.c
==============================================================================
--- branches/gimp-2-6/app/gegl/gimpcurvesconfig.c (original)
+++ branches/gimp-2-6/app/gegl/gimpcurvesconfig.c Thu Oct 9 09:44:56 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]