Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo/Redo functions are removing 2 objects at same time #42

Open
afnanz7634 opened this issue Oct 20, 2022 · 2 comments
Open

Undo/Redo functions are removing 2 objects at same time #42

afnanz7634 opened this issue Oct 20, 2022 · 2 comments

Comments

@afnanz7634
Copy link

Hello I'm using fabric js latest version and creating an editor tool. we create shapes by using mouse down and modify them when mouse is move . when I use undo/redo function it remove 2 objects at same time .
But when I add the shape first by clicking on the button with default width and height and top and left the undo redo function works fine.
i've tried to debug it on mouse down the object is added first with width and height 0 and on mouse move the object is modified with calculations of mouse movement thus 2 objects are maintained in the history instead of one how can i fix that ?

https://jsfiddle.net/durga598/7amunr73/2/

here is my code use it with history js and try to create multiple shapes and then use undo redo it will create the bug

image

@KesavarajaRK
Copy link

#36 Think this will be helpful.

@Saqib92
Copy link

Saqib92 commented Jan 8, 2024

facing same issue. only last 2 objects are getting deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants