Skip to content

Commit

Permalink
fix(grid): take row/column gap into consideration when drawing handle…
Browse files Browse the repository at this point in the history
…rs (#6292)

**Problem:**
The cell resize handlers are sometimes located incorrectly when there is
a grid gap (the semi-transparent handlers over the cells)
<img width="700" alt="image"
src="https://github.com/user-attachments/assets/2e6ac883-d083-4fe7-a603-70680d1d25b6">

**Fix:**
Take `rowGap`/`columnGap` into consideration as well when positioning
the handles
<img width="919" alt="image"
src="https://github.com/user-attachments/assets/928b76db-278b-4b16-816b-e90c68b8e8ec">

**Manual Tests:**
I hereby swear that:

- [X] I opened a hydrogen project and it loaded
- [X] I could navigate to various routes in Preview mode
  • Loading branch information
liady committed Dec 13, 2024
1 parent a70170d commit 2c82990
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions editor/src/components/canvas/controls/grid-controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ export const GridRowColumnResizingControls =
fromPropsAxisValues={grid.gridTemplateColumnsFromProps}
containingFrame={grid.frame}
axis={'column'}
gap={grid.gap}
gap={grid.columnGap ?? grid.gap}
padding={grid.padding}
/>
)
Expand All @@ -483,7 +483,7 @@ export const GridRowColumnResizingControls =
fromPropsAxisValues={grid.gridTemplateRowsFromProps}
containingFrame={grid.frame}
axis={'row'}
gap={grid.gap}
gap={grid.rowGap ?? grid.gap}
padding={grid.padding}
/>
)
Expand Down

0 comments on commit 2c82990

Please sign in to comment.