Skip to content

Commit

Permalink
Fix grid resize striped area length with per-axis gap (#6563)
Browse files Browse the repository at this point in the history
**Problem:**

When changing the grid gap via the canvas the row/column specific gap is
set (or using the split gap in the inspector), but it's not taken into
account when calculating the striped area length for grid resize.

**Fix:**

Take the `rowGap` / `columnGap` props into account when calculating the
striped area length in addition to the `gap` shorthand.

Fixes #6562
  • Loading branch information
ruggi authored Oct 18, 2024
1 parent e4c5e04 commit b27dfa8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions editor/src/components/canvas/controls/grid-controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ export const GridRowColumnResizingControlsComponent = ({
gap={grid.columnGap ?? grid.gap}
padding={grid.padding}
stripedAreaLength={
getStripedAreaLength(grid.gridTemplateRows, grid.gap ?? 0) ?? grid.frame.height
getStripedAreaLength(grid.gridTemplateRows, grid.rowGap ?? grid.gap ?? 0) ??
grid.frame.height
}
alignContent={grid.justifyContent}
justifyContent={grid.alignContent}
Expand All @@ -550,7 +551,8 @@ export const GridRowColumnResizingControlsComponent = ({
gap={grid.rowGap ?? grid.gap}
padding={grid.padding}
stripedAreaLength={
getStripedAreaLength(grid.gridTemplateColumns, grid.gap ?? 0) ?? grid.frame.width
getStripedAreaLength(grid.gridTemplateColumns, grid.columnGap ?? grid.gap ?? 0) ??
grid.frame.width
}
alignContent={grid.alignContent}
justifyContent={grid.justifyContent}
Expand Down

0 comments on commit b27dfa8

Please sign in to comment.