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

How to realize redo and undo? #471

Open
cpa0701 opened this issue Apr 29, 2024 · 2 comments
Open

How to realize redo and undo? #471

cpa0701 opened this issue Apr 29, 2024 · 2 comments

Comments

@cpa0701
Copy link

cpa0701 commented Apr 29, 2024

like title ,How to realize redo and undo?do we have to save schemas in every changing?

@atlasan
Copy link
Contributor

atlasan commented May 10, 2024

Yes, that's correct, seems expensive but actually it's quick (not sure if you how would do with thousands nodes ^_^)
The alternative would try to revert a single action but that's complex and some node would need to implement themself to rollback.
I had tried an internal implementation that works that way, probably needs some refactoring and fixing but that's the concept, https://github.com/atlasan/litegraph.js/blob/2ebb3fde22e7e7e367eecab11a7a45b38c8f6f70/src/litegraph.js#L154

@cpa0701
Copy link
Author

cpa0701 commented May 24, 2024

Yes, that's correct, seems expensive but actually it's quick (not sure if you how would do with thousands nodes ^_^) The alternative would try to revert a single action but that's complex and some node would need to implement themself to rollback. I had tried an internal implementation that works that way, probably needs some refactoring and fixing but that's the concept, https://github.com/atlasan/litegraph.js/blob/2ebb3fde22e7e7e367eecab11a7a45b38c8f6f70/src/litegraph.js#L154

i am really appreciate you !that is maybe what i want,i will try it,thanks again!

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

2 participants