daybrush / moveable

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

Clippable bounds to target #292

Closed fitzmode closed 3 years ago

fitzmode commented 4 years ago

Environments

Description

Thanks for the update! How can I keep a Clippable within bounds of the target?. I would like it to have it such that when I drag the Clippable component, it does not leave the the boundaries of the target.

daybrush commented 4 years ago

@fitzmode

There are no bounds and snap settings related to clippables yet.

happylinks commented 4 years ago

Would really like to have this! I'm building cropping with clippable. Do you think you'll add bounds + snap eventually?

daybrush commented 4 years ago

@happylinks @fitzmode

moveable's new version is released.

clipTargetBounds prop is added for bound . clipVerticalGuidelines, clipHorizontalGuidelines, clipSnapThreshold are added for snap. Try it. Thank you :)