summaryrefslogtreecommitdiff
path: root/src/gtkutil.c
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2012-12-12 19:33:30 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2012-12-12 19:33:30 +0400
commit2dd61a9b332356fa24d96527a71ef4fe29fb9e5c (patch)
tree880c9e07a5ca6bf5cf04ef80990704b2ada5730b /src/gtkutil.c
parentd0efe6ec5bc90a206c194a429e6cdfd86a8fb3d5 (diff)
* dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
* gtkutil.c (xg_set_toolkit_scroll_bar_thumb): * window.c (Frecenter): * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs): * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r--src/gtkutil.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 52a6c37b0d..9f2b652525 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3796,13 +3796,8 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
shown = (gdouble) portion / whole;
}
- size = shown * XG_SB_RANGE;
- size = min (size, XG_SB_RANGE);
- size = max (size, 1);
-
- value = top * XG_SB_RANGE;
- value = min (value, XG_SB_MAX - size);
- value = max (value, XG_SB_MIN);
+ size = clip_to_bounds (1, shown * XG_SB_RANGE, XG_SB_RANGE);
+ value = clip_to_bounds (XG_SB_MIN, top * XG_SB_RANGE, XG_SB_MAX - size);
/* Assume all lines are of equal size. */
new_step = size / max (1, FRAME_LINES (f));