* grub-core/gfxmenu/gui_list.c (draw_scrollbar): Fixed rare
occasional bug. If there are too many boot entries or too low scrollbar height then we need to use another formula to calculate the position and size of the scrollbar thumb.
This commit is contained in:
parent
de300af2ac
commit
53a5f5c2f0
2 changed files with 14 additions and 0 deletions
|
@ -219,6 +219,13 @@ draw_scrollbar (list_impl_t self,
|
|||
tracklen);
|
||||
int thumby = tracktop + tracklen * (value - min) / (max - min);
|
||||
int thumbheight = tracklen * extent / (max - min) + 1;
|
||||
/* Rare occasion: too many entries or too low height. */
|
||||
if (thumbheight < thumb_vertical_pad)
|
||||
{
|
||||
thumbheight = thumb_vertical_pad;
|
||||
thumby = tracktop + ((tracklen - thumb_vertical_pad) * (value - min)
|
||||
/ (max - extent));
|
||||
}
|
||||
thumb->set_content_size (thumb,
|
||||
scrollbar_width - frame_horizontal_pad
|
||||
- thumb_horizontal_pad,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue