- The bug in Tracker (previous commit) uncovered a bug in BScrollBar's thumb positioning. The + 1.0 was well intented and produced the right effect unless fMax-fMin was too close to 1.0. It could

leave a unusable gap on the right (or down) of the thumb.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25897 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexandre Deckner 2008-06-10 00:53:16 +00:00
parent ed27e7aef6
commit 6d4ab8b00e
1 changed files with 6 additions and 3 deletions

View File

@ -1171,9 +1171,12 @@ BScrollBar::_UpdateThumbFrame()
thumbSize = floorf(thumbSize + 0.5);
thumbSize--;
// the thumb can be scrolled within the remaining area "maxSize - thumbSize"
float offset = floorf(((fValue - fMin) / (fMax - fMin + 1.0))
* (maxSize - thumbSize));
// the thumb can be scrolled within the remaining area "maxSize - thumbSize - 1.0"
float offset = 0.0;
if (fMax > fMin) {
offset = floorf(((fValue - fMin) / (fMax - fMin))
* (maxSize - thumbSize - 1.0));
}
if (_DoubleArrows()) {
offset += buttonSize * 2;