app: argh, so much for less stupid

This commit is contained in:
Michael Natterer 2014-06-19 19:00:23 +02:00
parent 5a4e9d0e03
commit 40cbbf8faf
1 changed files with 10 additions and 15 deletions

View File

@ -588,6 +588,7 @@ gimp_spin_scale_change_value (GtkWidget *widget,
gint width;
gdouble value;
gint digits;
gint power = 1;
gimp_spin_scale_get_limits (GIMP_SPIN_SCALE (widget), &lower, &upper);
@ -622,22 +623,16 @@ gimp_spin_scale_change_value (GtkWidget *widget,
}
digits = gtk_spin_button_get_digits (spin_button);
while (digits--)
power *= 10;
if (digits > 0)
{
gint power = 1;
while (digits--)
power *= 10;
/* round the value to the possible precision of the spinbutton, so
* a focus-out will not change the value again, causing inadvertend
* adjustment signals.
*/
value *= power;
value = RINT (value);
value /= power;
}
/* round the value to the possible precision of the spinbutton, so
* a focus-out will not change the value again, causing inadvertend
* adjustment signals.
*/
value *= power;
value = RINT (value);
value /= power;
gtk_adjustment_set_value (adjustment, value);
}