Skip to content

Content Menu Hooks

Cdhaldane edited this page Jul 6, 2021 · 1 revision

Undo/Redo How it's done

  • Each action takes a snapshot and saves the state.
  • We save the state in the history as an array.
  • Each move has a corresponding index which is used to navigate between redo and undo.
  • Everything is done in the shape component as opposed to Editpage which allows Redux to not be needed.

Copy/Paste/Cut How it's done

  • Each shape has unique attributes which allow for easy cloning for the copy hook.
  • The cloned shape is stored in a state and called when needed to paste.
  • Still figuring out paste
  • Cut is as simple as delete and copy.

Delete How it's done

  • Changes the visibility of the shape to false.
  • Cannot delete shape as undo needs to bring it back.
  • Once the max stroage is reached the shape will be deleted.

Clone this wiki locally