Commit Graph
40 Commits
Author SHA1 Message Date
TrueDoctorandKeavon Chambers 28815b1ea4 Add function to serialize the layer structure to a 1D array (#363)
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2021-09-07 00:20:56 -07:00
TrueDoctor 0b5423b516 Implement Undo and Redo (#354)
* Implement undo and redo

* Create more save points and hook up menu entry

* Fix operation ordering

* Remove debug statement

* Fix folder changed order

* Don't store overlays in the history chain

* Keep selection
2021-08-26 12:20:00 +02:00
TrueDoctor 68d8ae4804 Implement bounding box for selected layers (#349)
* Implement bounding box for selected layers

* Add shift modifier for multi selection
2021-08-20 09:57:00 +02:00
TrueDoctor da290f1e63 Transform API (#301)
* Enforce cache dirtification

* Turn all shapes into one struct

* Remove working folder

* Remove old shapes

* Major restructuring

* Refactor Ellipse, Rectangle and ShapeTool

* Simplify bounding box calculation for folder

* Fix panic in select tool

*  Refactorselect tool

* Refactor Align

* Refactor flipping layers

* Zoom to fit all

* Refactor tools to avoid state keeping

* Refactor more tools to use state that is passed along

* Fix whitespace + change selection box style

* Set viewbox of svg export based on the contents
2021-08-06 12:34:30 +02:00
TrueDoctor 03c5847d7e Various small fixes and cleanups (#299) 2021-07-24 17:59:01 +02:00
TrueDoctor 70d1f77096 Hints backend (#234)
* Generate hints from list of actions

* Remove redundant Key from output

* Improve formatting

* Change logging verbosity for hints
2021-07-23 16:09:24 -07:00
TrueDoctor ed0a0c49d0 Rearrange layers refactor (#281)
* Keep selection during reordering

* Fix paste layer selection

* Remove junk from layer matadata

* Add function to get non_selected_layers

* Cleanup

* Add tests
2021-07-24 00:54:30 +02:00
TrueDoctor 87f65cd831 Add thumbnails for layers (#286)
Fixes: #285
2021-07-21 02:30:49 -07:00
TrueDoctor 5b1d36fafe Apply clippy lints (#278) 2021-07-17 11:12:37 +02:00
TrueDoctor 3075412c19 Order mapping entries precedence based on number of modifiers (#262)
* Order mapping entries precedence based on number of modifiers

* Fix format

* Rename variables

* More renaming
2021-07-15 00:40:37 +02:00
TrueDoctor d0d25d6d48 Implement snapping for rotation (#257) 2021-07-13 20:38:58 +02:00
TrueDoctor 521c21b837 Implement more scrolling features (#256)
* Use sideways scrolling

* Add horizontal scroll with shift

* Combine WheelCanvasTranslate messages

* Add zooming to current mouse position

* Fix formatting

* Fix scroll direction

* Rename some Constants
2021-07-13 14:02:38 +02:00
TrueDoctor db2561eb9f Simplify document selection by reusing code (#226) 2021-06-23 11:20:59 +02:00
TrueDoctor 0e488d99ff Delete selected layers (#173)
* Delete Layers
* Fix backend selection
* Fix shift selection
* Add desired shape add selection behavior
* Add X and Backspace as keybinds for layer deletion
* Change key storage to u128
* Remove unhelpful trace logging
* Reverse display direction for layers
2021-06-10 09:24:59 +02:00
TrueDoctor 8fa4b86d48 Implement backend part of the layer selection (#172)
* Implement backend part of the layer selection
2021-06-09 12:20:50 +02:00
TrueDoctor eb48fbd180 Export current document as SVG when pressing Ctrl+Shift+S (#160)
* Export current document when pressing Ctrl+Shift+S

* Use a blob for download

* Add Ctrl + E shortcut, match on lower case

* Don't mount element in DOM

* Polish some keybindings

* Add initialization for MappingEntries

* Implement svg coloring

* Add newline after svg tag

* Add spaces to svg style format

* Fix more svg formatting

* Add space before />

* Remove duplicate whitespace
2021-05-28 20:43:51 +02:00
a596ce0104 Major overhaul of input and communication systems
* Add input manager

* WIP lifetime hell

* Hell yeah, dark lifetime magic

* Replace events with actions in tools

* Fix borrow in GlobalEventHandler

* Fix typo in response-handler

* Distribute dispatch structure

* Add translation from events to actions

* Port default key actions to input_mapper

* Split actions macro

* Add handling for Ambiguous Mouse events

* Fix warnings and clippy lints

* Add actions macro

* WIP rework

* Add AsMessage macro

* Add implementation for derived enums

* Add macro implementation for top level message

* Add #[child] attribute to indicate derivation

* Replace some mentions of Actions and Responses with Message

* It compiles !!!

* Add functionality to some message handlers

* Add document rendering

* ICE

* Rework the previous code while keeping basic functionality

* Reduce parent-top-level macro args to only two

* Add workaround for ICE

* Fix cyclic reference in document.rs

* Make derive_transitive_child a bit more powerful

This addresses the todo that was left,
enabling arbitrary expressions to be passed as the last
parameter of a #[parent] attribute

* Adapt frontend message format

* Make responses use VecDeque

Our responses are a queue so we should use a queue type for them

* Move traits to sensible location

* Are we rectangle yet?

* Simplify, improve & document `derive_discriminant`

* Change `child` to `sub_discriminant`

This only applies to `ToDiscriminant`.
Code using `#[impl_message]` continues to work.

* Add docs for `derive_transitive_child`

* Finish docs and improve macros

The improvements are that impl_message now uses trait
resolution to obtain the parent's discriminant
and that derive_as_message now allows for non-unit
variants (which we don't use but it's nice to have,
just in case)

* Remove logging call

* Move files around and cleanup structure

* Fix proc macro doc tests

* Improve actions_fn!() macro

* Add ellipse tool

* Pass populated actions list to the input mapper

* Add KeyState bitvector

* Merge mouse buttons into "keyboard"

* Add macro for initialization of key mapper table

* Add syntactic sugar for the macro

* Implement mapping function

* Translate the remaining tools

* Fix shape tool

* Add keybindings for line and pen tool

* Fix modifiers

* Cleanup

* Add doc comments for the actions macro

* Fix formatting

* Rename MouseMove to PointerMove

* Add keybinds for tools

* Apply review suggestions

* Rename KeyMappings -> KeyMappingEntries

* Apply review changes

Co-authored-by: T0mstone <realt0mstone@gmail.com>
Co-authored-by: Paul Kupper <kupper.pa@gmail.com>
2021-05-23 01:26:24 +02:00
TrueDoctorandKeavon Chambers 437251f90e Plumb layer panel (#107)
* WIP ExpandFolder handling

* Implement response parsing in typescript

* Update layer panel with list sent by wasm

* Add events for layer interaction

* Add proper default naming

* Fix displaying of the eye icon

* Attach path to LayerPanelEntry

* Fix lint issues

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2021-05-07 10:41:38 -07:00
TrueDoctor 721a442b75 Use serde to serialize responses (#96) 2021-05-07 02:47:38 -07:00
TrueDoctor 9ad5f4ce78 Add npm run lint-no-fix option (#93) 2021-05-07 02:47:38 -07:00
TrueDoctor cb9d34c84d Improve rendering efficiency and add caching (#95)
Fixes #84

*Reduce heap allocations
* Add caching for rendering svgs
* Deduplicate UpdateCanvas Responses
2021-05-07 02:47:38 -07:00
TrueDoctor 5f1620b008 Add caching to svg rendering (#94)
* Add documentation for functions in the document library
* Restructure backchannel
2021-05-07 02:47:38 -07:00
TrueDoctor c540d781e1 Fix active tool selection (#92) 2021-05-07 02:47:38 -07:00
TrueDoctor 3ab5f6b7ef Add responses in document for layer system (#91) 2021-05-07 02:47:38 -07:00
TrueDoctor 0b3a53c223 Split mouse events according to the button pressed (#90) 2021-05-07 02:47:38 -07:00
TrueDoctor 9ffbb4ce39 Add transactions for temporary modifications to the document (#77)
* Add transactions for temporary modifications to the document

* Add DiscardTempFolder Operation

* Add clearFolder operation

* Rename Temp to Work
2021-04-21 00:32:36 +02:00
TrueDoctor 8c957e572b Implement svg layer structure (#59)
* Add folder struct

* Add file system like structure to interface with svgs

* Add primitive undo functionality

* Restructure layer system
2021-04-12 00:57:39 +02:00
TrueDoctor b7f18dfaa8 Implement key handling (#65) 2021-04-07 11:02:56 +02:00
TrueDoctor 89ed123356 Add ToolData and rectangle tool (#64) 2021-04-07 09:25:23 +02:00
TrueDoctor 593572a4e8 Add loging implementation for wasm (#56) 2021-03-30 18:48:32 +02:00
TrueDoctor 0e553adb32 Implement event/response roundtrip (#49) 2021-03-28 00:23:41 +01:00
TrueDoctor 04dc05e575 Rework the ToolState and integrate it into the Editor struct (#48)
* Rework the ToolState and integrate it into the Editor struct

* Add asset manager sources to docs outline
2021-03-27 22:02:01 +01:00
TrueDoctor 1b1e641aa8 Add event struct (#47) 2021-03-27 20:06:10 +01:00
TrueDoctor f9308a6d5a Add tool_state functionality to wasm-wrapper (#42) 2021-03-27 02:26:55 -07:00
TrueDoctor 1dfbe9192e Create basic CI workflow (#41) 2021-03-27 02:26:55 -07:00
TrueDoctor 8741e31c92 Add wasm-bindgen to Vue config (#38) 2021-03-27 02:26:55 -07:00
TrueDoctor 169a281fbf Rename layout to workspace and fix typo (#36) 2021-03-27 02:26:55 -07:00
TrueDoctor 6b93e2c008 Fix errors introduced in 29f5672 (#35) 2021-03-27 02:26:55 -07:00
TrueDoctor eb2255149a Define the js wasm-editor interface (#31) 2021-03-27 02:26:55 -07:00
TrueDoctor b3933f30bc Add graphite-editor library skeleton (#34) 2021-03-27 02:26:55 -07:00