Skip to content

Commit

Permalink
Revert "Masonry: Update fullWidthLayout to not floor column widths" (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyenwei authored Nov 19, 2024
1 parent ef3e902 commit 8d905a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/gestalt/src/Masonry/fullWidthLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const fullWidthLayout = <T>({
// original implementation takes with CSS.
const colguess = Math.floor(width / idealColumnWidth);
const columnCount = Math.max(Math.floor((width - colguess * gutter) / idealColumnWidth), minCols);
const columnWidth = width / columnCount - gutter;
const columnWidth = Math.floor(width / columnCount) - gutter;
const columnWidthAndGutter = columnWidth + gutter;
const centerOffset = gutter / 2;

Expand Down
2 changes: 1 addition & 1 deletion playwright/masonry/flexible-resize.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ test.describe('Masonry: flexible resize', () => {
const itemRectsAfter = await Promise.all(
gridItemsAfter.map((gridItemAfter) => gridItemAfter.boundingBox()),
);
expect(Math.floor(itemRectsAfter[0]?.width)).toBe(273);
expect(itemRectsAfter[0]?.width).toBe(273);
expect(itemRectsAfter[0]?.height).toBe(216);

// Get new sizes of grid items.
Expand Down

0 comments on commit 8d905a4

Please sign in to comment.