mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 12:57:31 +02:00
Apply a minimum size for the scroll bar thumb
On long lists the computed size can become less than 1 pixel.
This commit is contained in:
parent
60183e539d
commit
6492ab2fa2
@ -1088,7 +1088,7 @@ void GMenu2X::drawScrollBar(uint pageSize, uint totalSize, uint pagePos) {
|
||||
top += 2;
|
||||
height -= 4;
|
||||
|
||||
const uint barSize = height * pageSize / totalSize;
|
||||
const uint barSize = max(height * pageSize / totalSize, 4u);
|
||||
const uint barPos = (height - barSize) * pagePos / (totalSize - pageSize);
|
||||
|
||||
s->box(resX - 6, top + barPos, 3, barSize,
|
||||
|
Loading…
Reference in New Issue
Block a user