From b2720cd3d986ef628663dade27aa0247b382a2f3 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 30 Jan 2024 13:52:56 -0500 Subject: [PATCH] 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. --- src/kits/interface/ScrollView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/ScrollView.cpp b/src/kits/interface/ScrollView.cpp index aefe77a021..4d33a3daac 100644 --- a/src/kits/interface/ScrollView.cpp +++ b/src/kits/interface/ScrollView.cpp @@ -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(); }