[Feature request] Snap to grid
See original GitHub issueI would like to be able to drag and resize my elements while snapping to a grid
This is my workaround:
const getGrid = (grid: number) => {
const items = [0];
while(items[items.length - 1] < width) {
items.push(items[items.length - 1] + grid)
}
return items;
}
<Moveable
verticalGuidelines={getGrid(8)}
horizontalGuidelines={getGrid(8)}
/>
This solution is not good for big layouts.
We can do something like X % gridWidth === 0
and Y % gridHeight === 0
to check the grid lines instead of checking thousands of items in an array.
It could look like this
<Moveable
snapToGrid={true}
gridWidth={8}
gridHeight={8}
/>
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Feature request:Adding a snap to the grid - BOOX Help Center
Often it is drawn in different places of the note or other notes, and then it needs to be combined into one diagram,...
Read more >Feature request: Pen tool snap to grid and guides
When drawing illustrations, logos and icons with the Pen tool, it's important to be able to precisely place and edit vector points and ......
Read more >Snap to grid | Feature Requests - ProtoPie - Canny
Log in / Sign up. Roadmap · Feature Requests. 737. Voters. P. Powered by Canny. 3. Snap to grid. San Fran. Let us...
Read more >Add a "Snap to" Grid to the Workspaces - Feature Requests ...
I see that you talked about a snap to grid for the workspaces back in April so I would like to make it...
Read more >Snap to grid | Rebelle Ideas & Feature Requests | Forum | ..
I do like the ruler tool. but it would be nice to have snap to grid. and be able to set grid to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is a great feature. Thank you!
Thank you for PR.
react-moveable
0.28.3 is released.Check it again.