Implement Undo/Redo #4

Merged
enrico merged 2 commits from undo_redo into master 2020-11-09 10:49:20 +01:00
Collaborator

It seems to be working correctly.
Before the merge I would like a brief review, because I changed some bits.

I introduced a type alias Canvas for Vector<CanvasElement> to make signatures shorter, maybe a better name is due, (possibly we want an Abstract Data Type here, so we can abstract on the data structure, but not on this branch)

It seems to be working correctly. Before the merge I would like a brief review, because I changed some bits. I introduced a type alias `Canvas` for `Vector<CanvasElement>` to make signatures shorter, maybe a better name is due, (possibly we want an Abstract Data Type here, so we can abstract on the data structure, but not on this branch)
enrico reviewed 2020-11-09 10:12:42 +01:00
enrico approved these changes 2020-11-09 10:23:29 +01:00
@ -39,0 +84,4 @@
// so we first check if there are newer versions, if so
// this means we are in the past, so a change in the past destroys the future
// and creates a new future. If we want to keep all ramifications, we should use a tree,
// but honestly, this sounds like overkill.
Owner

I agree, I’ll leave out this consideration before pushing

I agree, I’ll leave out this consideration before pushing
Franciman marked this conversation as resolved
src/main.rs Outdated
@ -26,2 +26,3 @@
current_element: Option<CanvasElement>,
elements: Vector<CanvasElement>,
//elements: Vector<CanvasElement>,
history: History,
Owner

We could give it a more descriptive name, maybe VersionedCanvas?

We could give it a more descriptive name, maybe VersionedCanvas?
Franciman marked this conversation as resolved
enrico merged commit 9943681465 into master 2020-11-09 10:49:20 +01:00
Franciman deleted branch 2020-11-09 10:50:06 +01:00
enrico added this to the 0.1 milestone 2020-11-09 16:16:51 +01:00
Sign in to join this conversation.
No description provided.