checking if resource has changed

Started by
9 comments, last by Aardvajk 8 years, 9 months ago

This really reminds me of the Qt undo/redo scheme. I thought about doing this but some questions come to mind like how to represent continuous drag events - for instance when the user holds the mouse button down and drags a tile around - I would need to make a way to only undo the entire drag operation.


This is actually quite easy using Command pattern. You just need to store the original position when you start dragging, then actually add the command to the undo stack when the user releases the mouse. The command is then set up so undo takes you back to the original position and redo moves it to the final position.

Its a far better idea than adding a command to the stack on every mouse move anyway smile.png

This topic is closed to new replies.

Advertisement