From 6492ab2fa24aaa7dde2fe677e54760cb550a0b81 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Tue, 12 Aug 2014 00:01:40 +0200 Subject: [PATCH] Apply a minimum size for the scroll bar thumb On long lists the computed size can become less than 1 pixel. --- src/gmenu2x.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gmenu2x.cpp b/src/gmenu2x.cpp index 9bff18e..c52f5e7 100644 --- a/src/gmenu2x.cpp +++ b/src/gmenu2x.cpp @@ -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,