diff options
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
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); } |