mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 05:01:09 +00:00
Replace a really gross way of rounding to a specified number of digits.
2004-10-06 Matthias Clasen <mclasen@redhat.com> * gtk/gtkrange.c (gtk_range_real_change_value): Replace a really gross way of rounding to a specified number of digits. (#145232, Peter Zelezny, patch by Soeren Sandmann)
This commit is contained in:
parent
73e7b0838c
commit
f0d016ef38
@ -1,3 +1,9 @@
|
||||
2004-10-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkrange.c (gtk_range_real_change_value): Replace a really
|
||||
gross way of rounding to a specified number of digits. (#145232,
|
||||
Peter Zelezny, patch by Soeren Sandmann)
|
||||
|
||||
Wed Oct 6 00:45:04 2004 <timj@birnet.org>
|
||||
|
||||
* gdk/gdkwindow.c (gdk_window_is_viewable): check the iteration window
|
||||
|
@ -1,3 +1,9 @@
|
||||
2004-10-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkrange.c (gtk_range_real_change_value): Replace a really
|
||||
gross way of rounding to a specified number of digits. (#145232,
|
||||
Peter Zelezny, patch by Soeren Sandmann)
|
||||
|
||||
Wed Oct 6 00:45:04 2004 <timj@birnet.org>
|
||||
|
||||
* gdk/gdkwindow.c (gdk_window_is_viewable): check the iteration window
|
||||
|
@ -1,3 +1,9 @@
|
||||
2004-10-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkrange.c (gtk_range_real_change_value): Replace a really
|
||||
gross way of rounding to a specified number of digits. (#145232,
|
||||
Peter Zelezny, patch by Soeren Sandmann)
|
||||
|
||||
Wed Oct 6 00:45:04 2004 <timj@birnet.org>
|
||||
|
||||
* gdk/gdkwindow.c (gdk_window_is_viewable): check the iteration window
|
||||
|
@ -1,3 +1,9 @@
|
||||
2004-10-06 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkrange.c (gtk_range_real_change_value): Replace a really
|
||||
gross way of rounding to a specified number of digits. (#145232,
|
||||
Peter Zelezny, patch by Soeren Sandmann)
|
||||
|
||||
Wed Oct 6 00:45:04 2004 <timj@birnet.org>
|
||||
|
||||
* gdk/gdkwindow.c (gdk_window_is_viewable): check the iteration window
|
||||
|
@ -2390,12 +2390,15 @@ gtk_range_real_change_value (GtkRange *range,
|
||||
|
||||
if (range->round_digits >= 0)
|
||||
{
|
||||
char buffer[128];
|
||||
glong power;
|
||||
gint i;
|
||||
|
||||
/* This is just so darn lame. */
|
||||
g_snprintf (buffer, 128, "%0.*f",
|
||||
range->round_digits, value);
|
||||
sscanf (buffer, "%lf", &value);
|
||||
i = range->round_digits;
|
||||
power = 1;
|
||||
while (i--)
|
||||
power *= 10;
|
||||
|
||||
value = floor ((value * power) + 0.5) / power;
|
||||
}
|
||||
|
||||
if (range->adjustment->value != value)
|
||||
|
Loading…
Reference in New Issue
Block a user