The scrollbar handle now always has a height that is at least the width of the scrollbar

This commit is contained in:
Klaus Schmidinger
2008-02-23 10:50:28 +01:00
parent 3a70484121
commit 1b1267674f
5 changed files with 18 additions and 13 deletions

View File

@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: skinclassic.c 1.26 2008/02/22 16:56:29 kls Exp $
* $Id: skinclassic.c 1.27 2008/02/23 10:31:58 kls Exp $
*/
#include "skinclassic.h"
@@ -236,8 +236,9 @@ void cSkinClassicDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, in
int yb = yt + Height;
int st = yt;
int sb = yb;
int tt = st + (sb - st) * double(Offset) / Total + 0.5;
int tb = tt + (sb - st) * double(Shown) / Total + 0.5;
int th = max(int((sb - st) * double(Shown) / Total + 0.5), ScrollWidth);
int tt = min(int(st + (sb - st) * double(Offset) / Total + 0.5), sb - th);
int tb = min(tt + th, sb);
int xl = x3 - ScrollWidth;
osd->DrawRectangle(xl, st, x3 - 1, sb - 1, Theme.Color(clrMenuScrollbarTotal));
osd->DrawRectangle(xl, tt, x3 - 1, tb - 1, Theme.Color(clrMenuScrollbarShown));