Skip to content

Commit

Permalink
Fix scrollbar not clearing sometimes.
Browse files Browse the repository at this point in the history
  • Loading branch information
DecklynKern committed Oct 6, 2023
1 parent 636eb25 commit b2bf8ef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/btop_draw.cpp
Expand Up @@ -1556,8 +1556,11 @@ namespace Proc {
if (numpids > select_max) {
const int scroll_pos = clamp((int)round((double)start * select_max / (numpids - select_max)), 0, height - 5);
out += Mv::to(y + 1, x + width - 2) + Fx::b + Theme::c("main_fg") + Symbols::up
+ Mv::to(y + height - 2, x + width - 2) + Symbols::down
+ Mv::to(y + 2 + scroll_pos, x + width - 2) + "";
+ Mv::to(y + height - 2, x + width - 2) + Symbols::down;

for (int i = y + 2; i < y + height - 2; i++) {
out += Mv::to(i, x + width - 2) + ((i == y + 2 + scroll_pos) ? "" : " ");
}
}

//? Current selection and number of processes
Expand Down

0 comments on commit b2bf8ef

Please sign in to comment.