diff options
author | Graham Inggs <ginggs@debian.org> | 2018-02-05 14:48:53 +0200 |
---|---|---|
committer | Graham Inggs <ginggs@debian.org> | 2018-02-05 14:48:53 +0200 |
commit | 0bffedf65c053726a3a09be93c5eabfc113550fc (patch) | |
tree | 8c14970f1890c710df6f72aaa85781d62cee11e5 /Panel.c | |
parent | ba3d665468e9752a81a50bb2df7639950e0a3c77 (diff) | |
parent | 2ee50d030178cede83eb9d0005fbc19f819d30fe (diff) | |
download | debian_htop-0bffedf65c053726a3a09be93c5eabfc113550fc.tar.gz debian_htop-0bffedf65c053726a3a09be93c5eabfc113550fc.tar.bz2 debian_htop-0bffedf65c053726a3a09be93c5eabfc113550fc.zip |
Merge tag 'upstream/2.1.0'
Upstream version 2.1.0
Diffstat (limited to 'Panel.c')
-rw-r--r-- | Panel.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -407,12 +407,13 @@ bool Panel_onKey(Panel* this, int key) { break; case KEY_PPAGE: this->selected -= (this->h - 1); - this->scrollV -= (this->h - 1); + this->scrollV = MAX(0, this->scrollV - this->h + 1); this->needsRedraw = true; break; case KEY_NPAGE: this->selected += (this->h - 1); - this->scrollV = MIN(MAX(0, Vector_size(this->items) - this->h), this->selected - this->h); + this->scrollV = MAX(0, MIN(Vector_size(this->items) - this->h, + this->scrollV + this->h - 1)); this->needsRedraw = true; break; case KEY_WHEELUP: |