Commit Graph

1056 Commits (4e44084ef23d18f03fd64fc069af2f91502cfdff)

Author SHA1 Message Date
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
Isaiah Odhner 94d9c82e09 Explicitly modify undoable when finalizing selection
- Conditionally create an undoable for Deselect in case there's a Session Sync update in between selecting and deselecting (in Multi-User mode), and otherwise modify the undoable for Select/Free-Form Select
- Multi-User: Don't sync to the database CONSTANTLY while smearing a selection! (I should still add debouncing!)
2019-12-21 00:37:35 -05:00
Isaiah Odhner f9c5903400 Handle image data changed outside of undoable() better 2019-12-21 00:37:35 -05:00
Isaiah Odhner 8e22b008e0 Modify undoable explicitly for Load Document 2019-12-21 00:37:34 -05:00
Isaiah Odhner ac80b01b30 Add check and log around modifying undoables 2019-12-21 00:37:33 -05:00
Isaiah Odhner d7be1a1668 Restore redo-after-cancel functionality
NOTE: This changes the model for undoables, to something much more reasonable.
2019-12-21 00:37:31 -05:00
Isaiah Odhner b51d024db6 Restore dynamic preview cursor for Brush 2019-12-21 00:37:30 -05:00
Isaiah Odhner 9936034dc0 Get rid of "continuous" from interface 2019-12-21 00:37:29 -05:00
Isaiah Odhner 6d7220f60e Re-enable line drawing >1px width 2019-12-21 00:37:29 -05:00
Isaiah Odhner 8fa04517a9 Fix pencil / stroke size 1 brush behavior 2019-12-21 00:37:28 -05:00
Isaiah Odhner 1abe982b24 Fix brush continuity 2019-12-21 00:37:27 -05:00
Isaiah Odhner 9a72ee964f Stamp to make brush/pencil whole again 2019-12-21 00:37:26 -05:00
Isaiah Odhner 5f03bfa502 Fix: update helper layer for airbrush 2019-12-21 00:37:25 -05:00
Isaiah Odhner cedd93c753 Refactor 2019-12-21 00:37:23 -05:00
Isaiah Odhner 1cd26c17d3 Copy paste to get undoables back & color 2019-12-21 00:37:22 -05:00
Isaiah Odhner b1335343d6 WIP: optimize brush, pencil, & eraser performance
The plan is to try drawing a set of lines with WebGL based on the border of the shape of the brush.
2019-12-21 00:37:20 -05:00
Isaiah Odhner bfb0e64961 Perf: memoize get_rgba_from_color 2019-12-21 00:37:18 -05:00
Isaiah Odhner 1e4e855c16 Optimize multitouch panning performance
Fix the scope of when this totally unrelated thing happens.
2019-12-21 00:37:17 -05:00
Isaiah Odhner e0b500b7a3 Fix infinite loop of writing to database in Multi-User mode
Since I'm triggering session-update for every undoable, and creating an undoable when syncing from the database, this created a situation where, when you did multiple gestures rapidly, it would cause an infinite loop of writing to the database.

- Add a guard against that.
- Clarify function name and logs.
2019-12-21 00:37:16 -05:00
Isaiah Odhner 703fcd6105 Get rid of canvas-change.js
- Remove the whole ugly hacky module. Most things only modify the canvas when creating undoables now. Only a few things modify undoables after creating them.
- Formally disable pointer operations playback, instead of just leaving it accidentally disabled.
2019-12-21 00:37:15 -05:00
Isaiah Odhner c458108a17 Clean up 2019-12-18 02:26:43 -05:00
Isaiah Odhner cdfb37bcca Airbrush: don't create undoable until the end
- Redo after cancel is now broken for the Airbrush tool
2019-12-18 02:26:33 -05:00
Isaiah Odhner e992c89125 Brush: don't create undoable until the end
- Redo after cancel is now broken for the Brush tool
2019-12-18 02:26:03 -05:00
Isaiah Odhner c8063464e9 Pencil: don't create undoable until the end
- Patterns are now supported for the Pencil tool
- Redo after cancel is now broken for the Pencil tool
2019-12-10 20:13:16 -05:00
Isaiah Odhner 5f5503513e Fix undoable name for Eraser 2019-12-10 18:31:59 -05:00
Isaiah Odhner f856c6c1a3 Simplify 2019-12-10 17:54:00 -05:00
Isaiah Odhner 13e3b1f9b5 Show animated rainbow preview for Eraser in transparent mode 2019-12-10 17:47:39 -05:00
Isaiah Odhner 18bdf355f9 Eraser/Color Eraser: don't create undoable until finished
- The Color Eraser (color replacement) feature now supports patterns (i.e. with Black and White mode)
- This breaks the preview for transparent document mode. (Note: the dynamic cursor has never handled transparent document mode.)
- This breaks redo after Quick Undo
- May improve multi-user mode? Theoretically? Ignoring the above two things and maybe performance? I don't know.
2019-12-10 16:39:50 -05:00
Isaiah Odhner c215a02d4a Handle creating undoable in Fill tool 2019-12-10 14:45:57 -05:00
Isaiah Odhner 88d4074108 Shape tools: don't create undoable until finished
Don't create undoables for shapes until end

- Quick Undo: Canceling a gesture, you can no longer redo to bring the canceled result back. I should fix this.
- The history view will no longer show these actions until the tool finishes. This is fine. In the future I could show in-progress actions formally.
- MultiTools: additional undoables are created. MultiTools are already inconsistent with how undoables are created tho.
- Multi-User mode: may be improved by this?
2019-12-10 14:34:49 -05:00
Isaiah Odhner 5cdf23d3f7 Hide tool previews while panning 2019-12-10 10:43:46 -05:00
Isaiah Odhner 914a71c182 Use average of points for panning 2019-12-10 00:25:56 -05:00
Isaiah Odhner 0c57a2e0d8 Pan view with two finger drag in canvas area
- Fix crazy drawing while panning
2019-12-10 00:19:08 -05:00
Isaiah Odhner 610ff20fb3 WIP... 2019-12-09 23:32:28 -05:00