Don't allow setting a scrollbar position to nan.
Since nan != nan, the scrollbar would otherwise try to move the view to the new position, the view would try to set the scrollbar value again, and so on.
This commit is contained in:
@@ -379,6 +379,8 @@ BScrollBar::SetValue(float value)
|
||||
value = fMax;
|
||||
else if (value < fMin)
|
||||
value = fMin;
|
||||
else if(isnan(value))
|
||||
return;
|
||||
|
||||
value = roundf(value);
|
||||
|
||||
@@ -408,7 +410,7 @@ BScrollBar::ValueChanged(float newValue)
|
||||
{
|
||||
TRACE("BScrollBar(%s)::ValueChanged(%.1f)\n", Name(), newValue);
|
||||
|
||||
if (fTarget) {
|
||||
if (fTarget && newValue) {
|
||||
// cache target bounds
|
||||
BRect targetBounds = fTarget->Bounds();
|
||||
// if vertical, check bounds top and scroll if different from newValue
|
||||
|
||||
Reference in New Issue
Block a user