daybrush / moveable

Moveable! Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable! Groupable! Snappable!
https://daybrush.com/moveable/
MIT License
10.08k stars 618 forks source link

Fixed grid snapping snaps incorrect when snapGridWidth/Height not 10 #877

Closed CarlMahnke1 closed 1 year ago

CarlMahnke1 commented 1 year ago

Environments

Description

When you define a fixed grid other than 10px, you end up with one dimension not snapping correctly, but will default to snap to 10. Try these parameters: const snapGridWidth=20; const snapGridHeight=20; const snapThreshold=20;

alfredomariamilano commented 1 year ago

I have a similar problem, but it happens only with the vertical grid snap. It's always off by some pixels.