diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2008-02-22 17:02:31 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2008-02-22 17:02:31 +0100 |
commit | 3a704841210fa2b939e0158e29e79333da5817e7 (patch) | |
tree | 190c4697bf3a09ce3b8aa3e6555bbd8f87ce6452 /skinsttng.c | |
parent | 8bf512690ae3c1d367b79dc79674115be1e29571 (diff) | |
download | vdr-3a704841210fa2b939e0158e29e79333da5817e7.tar.gz vdr-3a704841210fa2b939e0158e29e79333da5817e7.tar.bz2 |
Revised the fix of calculating the scrollbar height in the skins
Diffstat (limited to 'skinsttng.c')
-rw-r--r-- | skinsttng.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/skinsttng.c b/skinsttng.c index 0aa22b72..95f4ebe3 100644 --- a/skinsttng.c +++ b/skinsttng.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinsttng.c 1.26 2008/02/17 14:23:45 kls Exp $ + * $Id: skinsttng.c 1.27 2008/02/22 16:56:30 kls Exp $ */ // Star Trek: The Next Generation® is a registered trademark of Paramount Pictures @@ -442,13 +442,13 @@ void cSkinSTTNGDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int if (Total > 0 && Total > Shown) { int h = lineHeight; int yt = Top; - int yb = yt + Height - 1; + int yb = yt + Height; int st = yt + h + Gap; int sb = yb - h - Gap; - int tt = st + (sb - st + 1) * Offset / Total; - int tb = tt + (sb - st + 1) * Shown / Total; - osd->DrawRectangle(x5, st, x5 + ScrollWidth - 1, sb, Theme.Color(clrMenuScrollbarTotal)); - osd->DrawRectangle(x5, tt, x5 + ScrollWidth - 1, tb, Theme.Color(clrMenuScrollbarShown)); + int tt = st + (sb - st) * double(Offset) / Total + 0.5; + int tb = tt + (sb - st) * double(Shown) / Total + 0.5; + osd->DrawRectangle(x5, st, x5 + ScrollWidth - 1, sb - 1, Theme.Color(clrMenuScrollbarTotal)); + osd->DrawRectangle(x5, tt, x5 + ScrollWidth - 1, tb - 1, Theme.Color(clrMenuScrollbarShown)); osd->DrawRectangle(x5, yt, x6 - 1, yt + h - 1, frameColor); osd->DrawEllipse (x6, yt, x7 - 1, yt + h - 1, frameColor, 5); osd->DrawRectangle(x5, yb - h, x6 - 1, yb - 1, frameColor); |