summaryrefslogtreecommitdiffstats
path: root/Panel.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2012-08-10 21:54:41 +0000
committerHisham Muhammad <hisham@gobolinux.org>2012-08-10 21:54:41 +0000
commite6c6d7fbf7c463c7e8c877b60059c47f1841e9c0 (patch)
treec3d960fd56abdf8b70647e2e6c2e7f85d66f0bc3 /Panel.c
parent6c71b7ed2dc6029e969b3329b6474b30e5e08c5b (diff)
Add -p flag, contributed by Rob Hoelz
Diffstat (limited to 'Panel.c')
-rw-r--r--Panel.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Panel.c b/Panel.c
index e8de2b86..d0f69bfd 100644
--- a/Panel.c
+++ b/Panel.c
@@ -250,7 +250,11 @@ void Panel_draw(Panel* this, bool focus) {
int scrollH = this->scrollH;
int y = this->y; int x = this->x;
int first = this->scrollV;
- int last = MIN(itemCount, this->scrollV + MIN(itemCount, this->h));
+ if (itemCount > this->h && first > itemCount - this->h) {
+ first = itemCount - this->h;
+ this->scrollV = first;
+ }
+ int last = MIN(itemCount, first + MIN(itemCount, this->h));
if (this->selected < first) {
first = this->selected;
this->scrollV = first;

© 2014-2024 Faster IT GmbH | imprint | privacy policy