Applied patch from Wim Lewis which fixes major uglyness (the code was

2006-07-25  Michael Natterer  <mitch@gimp.org>

	* 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.
This commit is contained in:
Michael Natterer 2006-07-25 09:42:12 +00:00 committed by Michael Natterer
parent 88a01e0867
commit 57d73d6a95
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2006-07-25 Michael Natterer <mitch@gimp.org>
* 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 <sven@gimp.org>
* app/core/gimp-edit.c: formatting.

View file

@ -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 */