Commit Graph

1089 Commits (8dd671f143f267c8b96c6ff5a1b7e7f569cbb98d)

Author SHA1 Message Date
Isaiah Odhner 8dd671f143 Add a database icon for Sync Session 2019-12-21 00:38:25 -05:00
Isaiah Odhner 5abef4221d Don't create Resize Canvas undoable if size unchanged
This is mainly for the Image Attributes window where there are other things you'll want to change in addition to the dimensions.
2019-12-21 00:38:25 -05:00
Isaiah Odhner dd2f2e5859 Refactor: reuse a function instead of an event
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.
2019-12-21 00:38:24 -05:00
Isaiah Odhner 98c44fe2b9 Rename undoable for enlarging for paste 2019-12-21 00:38:23 -05:00
Isaiah Odhner 2f1c431f3f Fix enlarging for paste
Fix warning dialog "History node switched during undoable callback for Paste: Enlarge. This shouldn't happen."

Don't do an undoable inside an undoable.
2019-12-21 00:38:22 -05:00
Isaiah Odhner e48d5ed955 Add icon for Delete 2019-12-21 00:38:20 -05:00
Isaiah Odhner d30745adb8 Add icons for Cut and Paste 2019-12-21 00:38:19 -05:00
Isaiah Odhner ea884b0382 Add icon for New Document and Clear 2019-12-21 00:38:18 -05:00
Isaiah Odhner 51fe6913ee Fix parenting of image transform undoables
`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).
2019-12-21 00:38:16 -05:00
Isaiah Odhner 9092d86ee2 Fix: don't merge and rename Stamp into Move 2019-12-21 00:38:15 -05:00
Isaiah Odhner a533be681f Fix app-breaking resize to zero with handles 2019-12-21 00:38:14 -05:00
Isaiah Odhner 6f819c7555 Fix app-breaking Stretch/Skew to zero width/height 2019-12-21 00:38:14 -05:00
Isaiah Odhner 9948d8f9bb DRY 2019-12-21 00:38:13 -05:00
Isaiah Odhner 6b24bc26e1 Unify borders of canvas representations in icons 2019-12-21 00:38:13 -05:00
Isaiah Odhner 433b01f1f3 Add icons for stretching and skewing 2019-12-21 00:38:12 -05:00
Isaiah Odhner 96d6d4c064 Add icons for flipping and rotating actions 2019-12-21 00:38:12 -05:00
Isaiah Odhner 8584debfe6 Dehack 2019-12-21 00:38:11 -05:00
Isaiah Odhner be216e5aad Add action icon for Invert 2019-12-21 00:38:11 -05:00
Isaiah Odhner f9069fd8ab DRY image inversion code 2019-12-21 00:38:10 -05:00
Isaiah Odhner 8c24c79fe1 Rename 2019-12-21 00:38:09 -05:00
Isaiah Odhner 2d9b3b0af6 Select appropriate tools when jumping around history
Prevent an awkward state of the app where you can draw/use tools *behind* a selection or textbox.
2019-12-21 00:38:08 -05:00
Isaiah Odhner dd56845498 Restore colors and transparent mode when jumping to Text history nodes 2019-12-21 00:38:07 -05:00
Isaiah Odhner 3e2146adaa Mark selection transformations as soft 2019-12-21 00:38:05 -05:00
Isaiah Odhner 02ceb5d6af Include selection in rendered document history GIFs 2019-12-21 00:38:04 -05:00
Isaiah Odhner 8cc6ccdd7d Preserve current branch as redos when navigating history
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.
2019-12-21 00:38:03 -05:00
Isaiah Odhner 8439ba682c Fix Quick Undo for Fill With Color tool 2019-12-21 00:38:03 -05:00
Isaiah Odhner 7d68cd1287 Rename history window opening actions
Leave the history window title as Document History. The History Tree is the main part of that.
2019-12-21 00:38:02 -05:00
Isaiah Odhner 829590e8d7 Fix: don't switch sessions if the session ID and type match
Don't switch if just the case changed in the session type specifier, e.g. from "#local:doc" to "#LOCAL:doc"
2019-12-21 00:38:01 -05:00
Isaiah Odhner b8b90be87e Fix switching between local and multi-user sessions with the same ID 2019-12-21 00:38:01 -05:00
Isaiah Odhner d19d2a80d5 Clean up and guard console logs 2019-12-21 00:38:00 -05:00
Isaiah Odhner f544cfa610 Fix Select, Delete both treated as soft so both skipped 2019-12-21 00:38:00 -05:00
Isaiah Odhner bc67fe79f0 Don't need this to bubble up
just cut to the chase
2019-12-21 00:37:59 -05:00
Isaiah Odhner c6f3d7b017 Update undoable name when a Stamp becomes a Smear 2019-12-21 00:37:58 -05:00
Isaiah Odhner 4e44084ef2 Fix "Unknown [undoable]" when loading canvas size 2019-12-21 00:37:58 -05:00
Isaiah Odhner 88709e0fe1 Remove unused code
There's actually only one usage of `make_or_update_undoable`
2019-12-21 00:37:57 -05:00
Isaiah Odhner 0be6084d26 Don't modify undoables that already have futures
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.
2019-12-21 00:37:56 -05:00
Isaiah Odhner ca4270789b De-hack melding text and selections 2019-12-21 00:37:56 -05:00
Isaiah Odhner 26dff1259c Move undoable creation to each selection creation site
- Fix "Unknown [undoable]" undoable created with Free-Form Select once you do something else (e.g. move it)
- Simplify things, and remove a HACK
2019-12-21 00:37:55 -05:00
Isaiah Odhner 95a52892ae Clean up 2019-12-21 00:37:54 -05:00
Isaiah Odhner 27331162de Skip soft undoables
- 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
2019-12-21 00:37:53 -05:00
Isaiah Odhner 6c20663afd Improve Stamp/Smear in history 2019-12-21 00:37:51 -05:00
Isaiah Odhner 1d9f56d0d4 Restructure arguments to undoable() 2019-12-21 00:37:50 -05:00
Isaiah Odhner 5ceb956ad8 Clean up 2019-12-21 00:37:49 -05:00
Isaiah Odhner f576d8b756 Include textboxes in history (Go back and edit!) 2019-12-21 00:37:47 -05:00
Isaiah Odhner bc3a450c47 Include selection and selection operations in history 2019-12-21 00:37:46 -05:00
Isaiah Odhner 100c20e497 Fix Free-Form Select 2019-12-21 00:37:45 -05:00
Isaiah Odhner a770627445 WIP towards soft undos (this doesn't work) 2019-12-21 00:37:42 -05:00
Isaiah Odhner 72734ff824 Make factory for history nodes 2019-12-21 00:37:40 -05:00
Isaiah Odhner 0014467d75 Sort history view by time 2019-12-21 00:37:38 -05:00
Isaiah Odhner 1e0d50140a Debounce autosave & multi-user session sync
- 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.
2019-12-21 00:37:37 -05:00