advanced-cropper / react-advanced-cropper

The react cropper library that embraces power of the advanced cropper core to give the possibility to create croppers that exactly suited for your website design
https://advanced-cropper.github.io/react-advanced-cropper/
Other
678 stars 34 forks source link

How to implement undo redo functionality while editing image? #54

Closed Abhi-Radadiya closed 3 months ago

Abhi-Radadiya commented 9 months ago

I am developing platform where user need to upload image and edit which has simple functionality rotate, crop and flip.

Now I have implemented undo-redo functionality for rotation and flipping an image but how to deal with crop?

https://github.com/advanced-cropper/react-advanced-cropper/assets/140842297/2cf3e838-3ca2-49a3-81af-9ac8890b7fb3

Norserium commented 8 months ago

@Abhi-Radadiya, you can remember the state on its change (onChange callback) and then set the corresponding state by setState method.

Norserium commented 3 months ago

@Abhi-Radadiya, I close this issue, but feel free to reopen in the future.