Fix scrollbars on Menu/MessageBox
This commit is contained in:
@ -80,11 +80,16 @@ class MessageBox
|
||||
$visibleItems = $height - 4;
|
||||
|
||||
// calculate scrollbar thumb positions
|
||||
$scrollTop = ($this->scroll / ($maxScroll + $visibleItems));
|
||||
$scrollVisible = $visibleItems / count($wrapped); // / $visibleItems;
|
||||
$scrollBottom = $scrollTop + $scrollVisible;
|
||||
$thumbTop = round($scrollTop * $visibleItems);
|
||||
$thumbBottom = round($visibleItems * $scrollBottom);
|
||||
// $scrollTop = ($this->scroll / ($maxScroll + $visibleItems));
|
||||
// $scrollVisible = $visibleItems / count($wrapped); // / $visibleItems;
|
||||
// $scrollBottom = $scrollTop + $scrollVisible;
|
||||
// $thumbTop = round($scrollTop * $visibleItems);
|
||||
// $thumbBottom = round($visibleItems * $scrollBottom);
|
||||
|
||||
$scrollTop = $this->scroll;
|
||||
$scrollBottom = $scrollTop + $visibleItems - 1;
|
||||
$thumbTop = round(($visibleItems - 1) / count($wrapped) * $scrollTop);
|
||||
$thumbBottom = round(($visibleItems - 1) / count($wrapped) * $scrollBottom);
|
||||
|
||||
echo "\e[40;37m";
|
||||
$this->terminal
|
||||
|
Reference in New Issue
Block a user