This repository has been archived by the owner on Dec 19, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
History & modal text editing
Cory McIlroy edited this page Aug 28, 2015
·
1 revision
Some brief notes of the process of creating and editing text layers with special consideration of the history system. A separate path is described for creating a text layer but then committing with no text, as well as creating a text layer that will replace the initial "placeholder" layer of a new document.
- clicking canvas
- event: createTextLayer
- addLayer PUSH HIST STATE
- ESC no text
- event deleteTextLayer
- removeLayer PUSH HIST STATE BUT THEN RESETS IT
normal path (works.. but I if we ever fix the abort-path, it could affect the WAY this works, in that history state should be added only after commit)
- clicking canvas
- event: createTextLayer
- addLayer PUSH HIST STATE
- type text then ESC
- event: historyState
- recognized as "current" and ignored
- event: make
- resetLayer AMEND HIST STATE
- click text layer with text tool
- update text, hit ESC
- event: historyState
- PUSH history state
- event: set
- resetLayer AMEND HISTORY STATE (except actually would be cooler to MARRY history instead of AMEND? this is a subtle difference, essentially works only if the pre is a rogue state?)
- normal (works same as above)
- w/ abort (hacky in a similar way - it UPDATES the document)