diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2009-08-14 23:10:53 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2009-08-14 23:10:53 +0000 |
commit | c26611b32b3796d4bbc886e7efd839ad999885c6 (patch) | |
tree | d6ba79dc0aa97c326449ee0e7eb57e25abed21c0 /desktop/scroll.c | |
parent | 45e05288f0b7f521dfe706ce152072c422cc8ae1 (diff) | |
download | netsurf-c26611b32b3796d4bbc886e7efd839ad999885c6.tar.gz netsurf-c26611b32b3796d4bbc886e7efd839ad999885c6.tar.bz2 |
Merge from Paul Blokus' selectscroll branch. Fixes text input scrollbar behaviour.
svn path=/trunk/netsurf/; revision=9306
Diffstat (limited to 'desktop/scroll.c')
-rw-r--r-- | desktop/scroll.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/desktop/scroll.c b/desktop/scroll.c index 248c70908..8b14e7a2a 100644 --- a/desktop/scroll.c +++ b/desktop/scroll.c @@ -489,24 +489,33 @@ int scroll_get_offset(struct scroll *scroll) /** - * Set the length of the scroll and the visible part of the scrolled area. + * Set the length of the scroll and the visible or scrolled part of the scrolled + * area. * * \param scroll the scroll to set the values for - * \param length the new scroll length to be set - * \param scrolled_visible the new value of the visible part of the + * \param length -1 or the new scroll length to be set + * \param scrolled_visible -1 or the new value of the visible part of the * scrolled area to be set + * \param scrolled_dimension -1 or the new dimension of the scrolled content */ -void scroll_set_length_and_visible(struct scroll *scroll, int length, - int scrolled_visible) +void scroll_set_extents(struct scroll *scroll, int length, + int scrolled_visible, int scrolled_dimension) { int well_length; - scroll->length = length; - scroll->scrolled_vis = scrolled_visible; + if (length != -1) + scroll->length = length; + if (scrolled_visible != -1) + scroll->scrolled_vis = scrolled_visible; + if (scrolled_dimension != -1) + scroll->scrolled_d = scrolled_dimension; + well_length = length - 2 * SCROLLBAR_WIDTH; scroll->bar_len = (well_length * scrolled_visible) / scroll->scrolled_d; + scroll->bar_off = (well_length * scroll->area_scroll) / + scroll->scrolled_d; } /** |