From 021ba88522a3e039d3bef94449e76f9a5d34a30c Mon Sep 17 00:00:00 2001 From: DanS Date: Fri, 3 Jul 2026 15:00:07 -0500 Subject: [PATCH] fix(market): extend portfolio drag dot-grid to the bottom of the viewport While rearranging, the dot grid only reached two rows below the lowest card, so the empty space beneath the cards showed no dots even though a card can be dropped there. Fill the grid down to the bottom of the visible scroll viewport (dl clip rect), keeping the two-row buffer as a minimum. The drop-target row is already unclamped, so dropping into that lower area places the card and grows the scrollable content. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ui/windows/market_tab.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ui/windows/market_tab.cpp b/src/ui/windows/market_tab.cpp index 8b5a32f..7060416 100644 --- a/src/ui/windows/market_tab.cpp +++ b/src/ui/windows/market_tab.cpp @@ -1544,10 +1544,15 @@ void RenderMarketTab(App* app) } }; - // Subtle dot grid while rearranging (fine 32px cells; extends into the buffer rows). + // Subtle dot grid while rearranging (fine 32px cells). Fill the whole visible grid area + // — down to the bottom of the scroll viewport, not just the occupied rows — so a card can + // be dropped anywhere, including the empty space below the current cards. if (interacting) { ImU32 dotc = WithAlpha(OnSurface(), 38); - for (int r = 0; r <= pfMaxRow + 2; r++) + float visibleBottom = dl->GetClipRectMax().y; // bottom edge of the scroll child + int rowsToBottom = (int)((visibleBottom - gy) / pfCellH) + 1; + int lastRow = std::max(pfMaxRow + 2, rowsToBottom); + for (int r = 0; r <= lastRow; r++) for (int c = 0; c <= pfCols; c++) dl->AddCircleFilled(ImVec2(cx + c * pfCellW, gy + r * pfCellH), 1.2f * mktDp, dotc); }