Browse Source

Making sure that the scroll knob can easily be seen.

David Piuva 5 years ago
parent
commit
7e1ae7376b
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Source/DFPSR/gui/components/ListBox.cpp

+ 3 - 0
Source/DFPSR/gui/components/ListBox.cpp

@@ -313,6 +313,9 @@ IRect ListBox::getKnobLocation() {
 	int64_t maxScroll = itemCount - visibleRange; // 0..maxScroll
 	int64_t maxScroll = itemCount - visibleRange; // 0..maxScroll
 	// Dimensions
 	// Dimensions
 	int64_t knobHeight = (erodedBar.height() * visibleRange) / itemCount;
 	int64_t knobHeight = (erodedBar.height() * visibleRange) / itemCount;
+	if (knobHeight < erodedBar.width()) {
+		knobHeight = erodedBar.width();
+	}
 	// Visual range for center
 	// Visual range for center
 	int64_t scrollStart = erodedBar.top() + knobHeight / 2;
 	int64_t scrollStart = erodedBar.top() + knobHeight / 2;
 	int64_t scrollDistance = erodedBar.height() - knobHeight;
 	int64_t scrollDistance = erodedBar.height() - knobHeight;