diff --git a/ChangeLog b/ChangeLog index b76a2fbf17..ea572797b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-07-25 Michael Natterer + + * app/tools/gimplevelstool.c (levels_input_area_event): Applied + patch from Wim Lewis which fixes major uglyness (the code was + rounding using sprintf() and atof() -- puke). Fixes bug #348317. + 2006-07-20 Sven Neumann * app/core/gimp-edit.c: formatting. diff --git a/app/tools/gimplevelstool.c b/app/tools/gimplevelstool.c index a366f98961..85efea3e9a 100644 --- a/app/tools/gimplevelstool.c +++ b/app/tools/gimplevelstool.c @@ -1022,7 +1022,6 @@ levels_input_area_event (GtkWidget *widget, { GdkEventButton *bevent; GdkEventMotion *mevent; - gchar text[12]; gint x, distance; gint i; gboolean update = FALSE; @@ -1105,8 +1104,8 @@ levels_input_area_event (GtkWidget *widget, tool->levels->gamma[tool->channel] = 1.0 / pow (10, tmp); /* round the gamma value to the nearest 1/100th */ - sprintf (text, "%2.2f", tool->levels->gamma[tool->channel]); - tool->levels->gamma[tool->channel] = atof (text); + tool->levels->gamma[tool->channel] = + floor (tool->levels->gamma[tool->channel] * 100 + 0.5) / 100.0; break; case 2: /* high input */