aboutsummaryrefslogtreecommitdiffstats
path: root/Panel.c
diff options
context:
space:
mode:
authorGraham Inggs <ginggs@debian.org>2018-02-05 14:48:51 +0200
committerGraham Inggs <ginggs@debian.org>2018-02-05 14:48:51 +0200
commit2ee50d030178cede83eb9d0005fbc19f819d30fe (patch)
tree67d75c0a7c47e15bed9d0735ecf12abec4f8157b /Panel.c
parent31b71b67011fa52f091df6fe536a11d6d0bfb256 (diff)
downloaddebian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.tar.gz
debian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.tar.bz2
debian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.zip
Imported Upstream version 2.1.0upstream/2.1.0
Diffstat (limited to 'Panel.c')
-rw-r--r--Panel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Panel.c b/Panel.c
index 579a82c..8c4d44f 100644
--- a/Panel.c
+++ b/Panel.c
@@ -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:

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