Fixed grid alignment issue

This commit is contained in:
Yousef Khadadeh 2026-04-21 18:52:11 +03:00
parent c75c668bf7
commit 06dd550067
2 changed files with 2 additions and 3 deletions

View file

@ -24,7 +24,7 @@ void GridScrollArea::layout(const Clay_ElementId& id, const Options& o) {
opts.entryCount = rowCount;
uint16_t xPadding = 0;
if(rowCount > 1 || (rowCount == 1 && ((options.entryCount + entriesPerRow) / entriesPerRow) > 1)) // More than 1 row or 1st row is full
xPadding = static_cast<float>(std::max<float>(rowWidth - (entriesPerRow * options.entryWidth), 0) / (entriesPerRow * 2));
xPadding = static_cast<float>(std::max<float>(rowWidth - (entriesPerRow * options.entryWidth), 0) / (entriesPerRow + 1));
opts.elementContent = [&] (size_t rowIndex) {
gui.new_id("grid row", [&] {