The event was only meant to be sent
By the handles, was my initial intent
The event was bent, and the code grew a scent
Which wafted around, and finally went
And rose up my nose
Up into my head
And now it goes
Thru a function instead.
Fix warning dialog "History node switched during undoable callback for Paste: Enlarge. This shouldn't happen."
Don't do an undoable inside an undoable.
`cancel()` inside `undoable()` action callback caused it to navigate history,
and it would navigate all the way to the start of the last pointer gesture because
`history_node_to_cancel_to` was only set on pointerdown, not taking into account non-pointer-gesture operations.
The point was to allow undoing Fill With Color when canceling, but with the old definition of `history_node_to_cancel_to` it would have needed to be set in scattered places.
Now I'm defining it where it can be null, and if it's null, canceling should just go back to the history node at the start of `cancel()` (after making history nodes if applicable by telling tools to finish).
For instance if you cancel a brush stroke and then cancel another, and redo, it'll now go to the newer brush stroke.
It doesn't just go to the latest tho, if you jump to the first canceled brush stroke in the history tree,
undo and redo and you'll stay with the older brush stroke, staying on that branch of the tree.
For instance, in the sequence Select, Move Selection, Deselect, go back to Move Selection, move it more,
previously the changes got merged into the existing Move Selection.
Now a second Move Selection is created branching off of the first.
- Fixes undoing past Text tool, where otherwise it would trap Ctrl+Z for the textbox
- To access these undoables, you have to use the Document History window
- When holding down Ctrl+Z or Ctrl+Shift+Z, it will now save only once or twice (at the end and usually the begining), instead of saving/syncing constantly, causing it to lag and not even show what's going on
- This fixes a situation where redo-after-cancel wouldn't work:
User cancels operation
(in cancel():) op finalized, creating undoable -> sync to DB
(in cancel():) cancel goes back to history node at start of cancel -> sync to DB
DB syncs first update -> undoable("Session Sync")
DB syncs second update -> undoable("Session Sync")
The history ends on "Session Sync", on a branch separate from the canceled operation.