BScrollBar: Unify PreferredSize computations.

Reduces code duplication. This should not significantly affect
actually computed sizes.
This commit is contained in:
Augustin Cavalier 2020-07-04 19:48:42 -04:00
parent 9fe3529f3e
commit 9481a1ec39

View File

@ -1043,12 +1043,8 @@ BScrollBar::MaxSize()
BSize
BScrollBar::PreferredSize()
{
BSize preferredSize = _MinSize();
if (fOrientation == B_HORIZONTAL)
preferredSize.width *= 2;
else
preferredSize.height *= 2;
BSize preferredSize;
GetPreferredSize(&preferredSize.width, &preferredSize.height);
return BLayoutUtils::ComposeSize(ExplicitPreferredSize(), preferredSize);
}