Commit 8653097b authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

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().
parent 4a50e7a1
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.
......
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.
......
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.
......
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.
......
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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment