From b06e026f97012a82618317600520c429c1c1b013 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 2 Sep 2009 06:34:40 +0000 Subject: (svn r17365) -Codechange: introduce wrapper functions to update the position, capacity and count of scroll bars. This to (eventually) prevent the scrollbar overflowing outside of the window --- src/window.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/window.cpp') diff --git a/src/window.cpp b/src/window.cpp index f513a48aa..69d7b707b 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2635,10 +2635,7 @@ int PositionMainToolbar(Window *w) */ void SetVScrollCount(Window *w, int num) { - w->vscroll.count = num; - num -= w->vscroll.cap; - if (num < 0) num = 0; - if (num < w->vscroll.pos) w->vscroll.pos = num; + w->vscroll.SetCount(num); } /** @@ -2650,10 +2647,7 @@ void SetVScrollCount(Window *w, int num) */ void SetVScroll2Count(Window *w, int num) { - w->vscroll2.count = num; - num -= w->vscroll2.cap; - if (num < 0) num = 0; - if (num < w->vscroll2.pos) w->vscroll2.pos = num; + w->vscroll2.SetCount(num); } /** @@ -2665,10 +2659,7 @@ void SetVScroll2Count(Window *w, int num) */ void SetHScrollCount(Window *w, int num) { - w->hscroll.count = num; - num -= w->hscroll.cap; - if (num < 0) num = 0; - if (num < w->hscroll.pos) w->hscroll.pos = num; + w->hscroll.SetCount(num); } -- cgit v1.2.3-54-g00ecf