Fixed more issues with grid and scroll area

This commit is contained in:
Yousef Khadadeh 2026-04-19 13:37:16 +03:00
parent 0853df4d2a
commit 4e1ab6fc50
6 changed files with 9 additions and 29 deletions

View file

@ -34,7 +34,7 @@ void GridScrollArea::layout(const Clay_ElementId& id, const Options& o) {
size_t startIndex = rowIndex * entriesPerRow;
size_t endIndex = std::min(rowIndex * entriesPerRow + entriesPerRow, o.entryCount);
for(size_t i = startIndex; i < endIndex; i++) {
gui.new_id(static_cast<int64_t>(i), [&] {
gui.new_id(static_cast<int64_t>(i - startIndex), [&] {
CLAY_AUTO_ID({
.layout = {.sizing = {.width = CLAY_SIZING_FIXED(entryWidth), .height = CLAY_SIZING_FIXED(options.entryHeight)}}
}) {