summaryrefslogtreecommitdiff
path: root/gtk/gtkrange.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-11-02 01:13:31 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-11-02 01:13:31 +0000
commit04e8bd13a986623cf5c374a87b05a9fbd2f693c8 (patch)
tree8ab799819d19b34c1283b30bd771c1eb6d32aa6d /gtk/gtkrange.c
parent55676c57bdd13fa717f5b7e508cf1432a4b771c3 (diff)
downloadgtk+-04e8bd13a986623cf5c374a87b05a9fbd2f693c8.tar.gz
Patch from George Lebl to fix division by zero for full scroll bars.
Thu Nov 1 20:09:31 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkrange.c: Patch from George Lebl to fix division by zero for full scroll bars. (#62114)
Diffstat (limited to 'gtk/gtkrange.c')
-rw-r--r--gtk/gtkrange.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 6e63141ea6..a453086ecf 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -1958,8 +1958,9 @@ gtk_range_calc_layout (GtkRange *range,
y = top;
- y += (bottom - top - height) * ((adjustment_value - range->adjustment->lower) /
- (range->adjustment->upper - range->adjustment->lower - range->adjustment->page_size));
+ if (range->adjustment->upper - range->adjustment->lower - range->adjustment->page_size != 0)
+ y += (bottom - top - height) * ((adjustment_value - range->adjustment->lower) /
+ (range->adjustment->upper - range->adjustment->lower - range->adjustment->page_size));
y = CLAMP (y, top, bottom);