BScrollView: Ajust minimum dimensions as little as necessary.

If the dimensions are already larger than needed, don't add to them.
Fixes Terminal and other non-layout applications' display
following the prior change.
This commit is contained in:
Augustin Cavalier
2023-05-31 14:47:40 -04:00
parent de07bc3fa5
commit fbcc7b2711
+8 -2
View File
@@ -918,11 +918,17 @@ BScrollView::_ComputeFrame(BRect frame, BScrollBar* horizontal,
{
if (vertical != NULL) {
frame.right += vertical->PreferredSize().Width();
frame.bottom += vertical->MinSize().Height();
const float minHeight = vertical->MinSize().Height();
if (frame.Height() < minHeight)
frame.bottom += minHeight - frame.Height();
}
if (horizontal != NULL) {
frame.right += horizontal->MinSize().Width();
frame.bottom += horizontal->PreferredSize().Height();
const float minWidth = horizontal->MinSize().Width();
if (frame.Width() < minWidth)
frame.right += minWidth - frame.Width();
}
_InsetBorders(frame, border, borders, true);