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) <noreply@anthropic.com>
This commit is contained in:
2026-07-03 15:00:07 -05:00
parent c1d5f79502
commit 021ba88522

View File

@@ -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);
}