mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
Return 0 if lower == upper. (#109155)
2003-04-02 Matthias Clasen <maclas@gmx.de> * gtk/gtkprogress.c (gtk_progress_get_percentage_from_value): Return 0 if lower == upper. (#109155) (gtk_progress_get_current_percentage): Use gtk_progress_get_percentage_from_value().
This commit is contained in:
parent
4a50e7a17a
commit
8653097b33
@ -1,3 +1,10 @@
|
||||
2003-04-02 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkprogress.c (gtk_progress_get_percentage_from_value):
|
||||
Return 0 if lower == upper. (#109155)
|
||||
(gtk_progress_get_current_percentage): Use
|
||||
gtk_progress_get_percentage_from_value().
|
||||
|
||||
2003-04-01 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimcontext.c (gtk_im_context_focus_in): Fix docs.
|
||||
|
@ -1,3 +1,10 @@
|
||||
2003-04-02 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkprogress.c (gtk_progress_get_percentage_from_value):
|
||||
Return 0 if lower == upper. (#109155)
|
||||
(gtk_progress_get_current_percentage): Use
|
||||
gtk_progress_get_percentage_from_value().
|
||||
|
||||
2003-04-01 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimcontext.c (gtk_im_context_focus_in): Fix docs.
|
||||
|
@ -1,3 +1,10 @@
|
||||
2003-04-02 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkprogress.c (gtk_progress_get_percentage_from_value):
|
||||
Return 0 if lower == upper. (#109155)
|
||||
(gtk_progress_get_current_percentage): Use
|
||||
gtk_progress_get_percentage_from_value().
|
||||
|
||||
2003-04-01 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimcontext.c (gtk_im_context_focus_in): Fix docs.
|
||||
|
@ -1,3 +1,10 @@
|
||||
2003-04-02 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkprogress.c (gtk_progress_get_percentage_from_value):
|
||||
Return 0 if lower == upper. (#109155)
|
||||
(gtk_progress_get_current_percentage): Use
|
||||
gtk_progress_get_percentage_from_value().
|
||||
|
||||
2003-04-01 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimcontext.c (gtk_im_context_focus_in): Fix docs.
|
||||
|
@ -1,3 +1,10 @@
|
||||
2003-04-02 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkprogress.c (gtk_progress_get_percentage_from_value):
|
||||
Return 0 if lower == upper. (#109155)
|
||||
(gtk_progress_get_current_percentage): Use
|
||||
gtk_progress_get_percentage_from_value().
|
||||
|
||||
2003-04-01 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkimcontext.c (gtk_im_context_focus_in): Fix docs.
|
||||
|
@ -570,8 +570,7 @@ gtk_progress_get_current_percentage (GtkProgress *progress)
|
||||
if (!progress->adjustment)
|
||||
gtk_progress_set_adjustment (progress, NULL);
|
||||
|
||||
return ((progress->adjustment->value - progress->adjustment->lower) /
|
||||
(progress->adjustment->upper - progress->adjustment->lower));
|
||||
return gtk_progress_get_percentage_from_value (progress, progress->adjustment->value);
|
||||
}
|
||||
|
||||
gdouble
|
||||
@ -583,7 +582,8 @@ gtk_progress_get_percentage_from_value (GtkProgress *progress,
|
||||
if (!progress->adjustment)
|
||||
gtk_progress_set_adjustment (progress, NULL);
|
||||
|
||||
if (value >= progress->adjustment->lower &&
|
||||
if (progress->adjustment->lower < progress->adjustment->upper &&
|
||||
value >= progress->adjustment->lower &&
|
||||
value <= progress->adjustment->upper)
|
||||
return (value - progress->adjustment->lower) /
|
||||
(progress->adjustment->upper - progress->adjustment->lower);
|
||||
|
Loading…
Reference in New Issue
Block a user