BScrollView: Don't adjust other dimension if it's negative.

Some non-layout applications start out with negative
view dimensions. Making them positive too early on can
break the view's appearance, it seems.

Fixes #18690.
This commit is contained in:
Augustin Cavalier 2024-01-30 13:52:56 -05:00
parent 230de61bd6
commit b2720cd3d9
1 changed files with 2 additions and 2 deletions

View File

@ -920,14 +920,14 @@ BScrollView::_ComputeFrame(BRect frame, BScrollBar* horizontal,
frame.right += vertical->PreferredSize().Width();
const float minHeight = vertical->MinSize().Height();
if (frame.Height() < minHeight)
if (frame.Height() >= 0 && frame.Height() < minHeight)
frame.bottom += minHeight - frame.Height();
}
if (horizontal != NULL) {
frame.bottom += horizontal->PreferredSize().Height();
const float minWidth = horizontal->MinSize().Width();
if (frame.Width() < minWidth)
if (frame.Width() >= 0 && frame.Width() < minWidth)
frame.right += minWidth - frame.Width();
}