Avoid a possible division by zero. (#77820)

* gtk/gtkrange.c (gtk_range_calc_layout): Avoid a possible
	division by zero.  (#77820)
This commit is contained in:
Matthias Clasen 2002-04-25 20:49:59 +00:00
parent c09a9a9fe1
commit 82a4dddf42
7 changed files with 36 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2002-04-25 Matthias Clasen <maclas@gmx.de>
* gtk/gtkrange.c (gtk_range_calc_layout): Avoid a possible
division by zero. (#77820)
Thu Apr 25 20:24:37 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): use the child's

View File

@ -1,3 +1,8 @@
2002-04-25 Matthias Clasen <maclas@gmx.de>
* gtk/gtkrange.c (gtk_range_calc_layout): Avoid a possible
division by zero. (#77820)
Thu Apr 25 20:24:37 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): use the child's

View File

@ -1,3 +1,8 @@
2002-04-25 Matthias Clasen <maclas@gmx.de>
* gtk/gtkrange.c (gtk_range_calc_layout): Avoid a possible
division by zero. (#77820)
Thu Apr 25 20:24:37 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): use the child's

View File

@ -1,3 +1,8 @@
2002-04-25 Matthias Clasen <maclas@gmx.de>
* gtk/gtkrange.c (gtk_range_calc_layout): Avoid a possible
division by zero. (#77820)
Thu Apr 25 20:24:37 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): use the child's

View File

@ -1,3 +1,8 @@
2002-04-25 Matthias Clasen <maclas@gmx.de>
* gtk/gtkrange.c (gtk_range_calc_layout): Avoid a possible
division by zero. (#77820)
Thu Apr 25 20:24:37 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): use the child's

View File

@ -1,3 +1,8 @@
2002-04-25 Matthias Clasen <maclas@gmx.de>
* gtk/gtkrange.c (gtk_range_calc_layout): Avoid a possible
division by zero. (#77820)
Thu Apr 25 20:24:37 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): use the child's

View File

@ -2041,8 +2041,12 @@ gtk_range_calc_layout (GtkRange *range,
/* slider height is the fraction (page_size /
* total_adjustment_range) times the trough height in pixels
*/
height = ((bottom - top) * (range->adjustment->page_size /
(range->adjustment->upper - range->adjustment->lower)));
if (range->adjustment->upper - range->adjustment->lower != 0)
height = ((bottom - top) * (range->adjustment->page_size /
(range->adjustment->upper - range->adjustment->lower)));
else
height = range->min_slider_size;
if (height < range->min_slider_size ||
range->slider_size_fixed)