44af3184d30fc5445a5371ca489b3a72bf3b4250
Selecting a building after a piece of debris left a scroll bar on a card that had nothing to scroll. Two faults, both found by driving the panel through the reported sequences and printing what it measured itself to: The bar was Qt's decision. Asked for ScrollBarAsNeeded, the scroll area shows a bar the moment the card is larger than its viewport -- which is true while the card is being measured, since measuring means giving it a width -- and does not take it back when the range turns out to be empty. The panel already works out whether the card fits its band and widens itself for the bar when it does not, so it now sets the policy itself: AlwaysOn when it decided to scroll, AlwaysOff when it did not. The previous commit's resize-to-cap made this visible; removing that alone traded the phantom bar for a real one, because the card's height depends on the width it is measured at. The measurement was also a pass short. A card's width follows from the room it is given and its height from that width, so refit() measures twice: once at the cap to learn the width the card wants, once at that width for the height. The whole thing then runs twice, because parts of a freshly built card report an unstyled size until the style reaches them during the first round -- that gap was leaving the panel a few pixels short of what the card turned out to need, which is a scroll bar over a card that looks like it fits. Measured before and after, HQ card, roomy band: before panel=113x114 card wants 111x121 bar visible, range empty after panel=113x123 card wants 111x121 no bar And in a 90px band it still scrolls: panel=130x74, range 47, bar shown. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcReq7hVk4KUPhTDKWAG7K
Description
No description provided
Languages
C++
96%
CMake
2.2%
Python
1.2%
C
0.6%