Add -p flag, contributed by Rob Hoelz

This commit is contained in:
Hisham Muhammad
2012-08-10 21:54:41 +00:00
parent 6c71b7ed2d
commit e6c6d7fbf7
5 changed files with 50 additions and 13 deletions

View File

@ -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;