1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-25 17:58:27 +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:
Maarten ter Huurne 2014-08-12 00:01:40 +02:00
parent 60183e539d
commit 6492ab2fa2

View File

@ -1088,7 +1088,7 @@ void GMenu2X::drawScrollBar(uint pageSize, uint totalSize, uint pagePos) {
top += 2; top += 2;
height -= 4; height -= 4;
const uint barSize = height * pageSize / totalSize; const uint barSize = max(height * pageSize / totalSize, 4u);
const uint barPos = (height - barSize) * pagePos / (totalSize - pageSize); const uint barPos = (height - barSize) * pagePos / (totalSize - pageSize);
s->box(resX - 6, top + barPos, 3, barSize, s->box(resX - 6, top + barPos, 3, barSize,