diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2012-08-10 21:54:41 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2012-08-10 21:54:41 +0000 |
commit | e6c6d7fbf7c463c7e8c877b60059c47f1841e9c0 (patch) | |
tree | c3d960fd56abdf8b70647e2e6c2e7f85d66f0bc3 /Panel.c | |
parent | 6c71b7ed2dc6029e969b3329b6474b30e5e08c5b (diff) |
Add -p flag, contributed by Rob Hoelz
Diffstat (limited to 'Panel.c')
-rw-r--r-- | Panel.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |