Why Should Undo be in the Same if as node drag

Firstly great tutorial :smiley:.
Secondly, One thing I don’t get is why should Undo be in same else-if statement as Node Drag movement is. Wouldn’t it recorded every single pixel position?! I thought it should be in first if statement there it should record before movement starts.
I tested both and drag statement is correct one, because when I add it to first if, it behaves like broken sometimes it records Undo, sometimes Redo. So, Yeah it was a not so correct place to write.
But now second question. When in drag statement Why doesn’t it record every single position and only records the first and last positions. Like it’s great, less brain work and code, but simply want to know the reason :smiley:

1 Like

It’s all part of the magic of the Undo system. It pattern matches, so if you repeatedly hit the Undo system with a series of the same this, “Thing I changed” then Undo knows to hang on to the original Undo position. I believe there’s a timeout so if you stopped dragging for a few seconds, and then dragged again, that would become a new event.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms