From fbcc7b2711dcb3ed611911826e5317da3dd510d5 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 31 May 2023 14:47:19 -0400 Subject: [PATCH] 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. --- src/kits/interface/ScrollView.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/ScrollView.cpp b/src/kits/interface/ScrollView.cpp index eda3f860e2..aefe77a021 100644 --- a/src/kits/interface/ScrollView.cpp +++ b/src/kits/interface/ScrollView.cpp @@ -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);