Commit graph

26 commits

Author SHA1 Message Date
Keavon Chambers
1b37e78d64 Remove CLI client stub 2021-07-15 03:44:57 -07:00
Till Arnold
20420c1286
Copy and paste layers MVP (#220)
* Initial implementation of copy and paste for layers

* Sort layers on copy and add tests

* Fix logger init for test

* Fix `copy_paste_deleted_layers` test

* Readd erroneously removed svg

* Make Layer serializable and cleanup

* Add test for copy and pasting folders

* Cleanup

* Rename left_mouseup

* Cleanup

* Add length check to test

* Fix typo

* Make mouseup, mousedown more consistent
2021-07-04 15:34:47 -07:00
0HyperCube
69a446091f
Remove partialeq for layers (#230) 2021-06-29 21:06:37 +01:00
0HyperCube
f76517a14d
Add a movable canvas with matricies (#175)
* Convert polygon and rectangle tool to kurbo::BezPath

* Add glam

* Add affine transform to elipse and remove circle

* Format

* Add svg group and add matrix for group

* Convert all operations to use matricies

* Work uses same transform as root

* Format

* Frontend fixed to render changes to working colors when changed from backend (#180)

* Backend and Frontend modification to show working color mods

* Remove comments & change precedence for tool and doc actions

* Add keybind for resetting work colors

* Minor Frontend changes

* Remove early sample "greet" code

* Add a contributing section to the project README

* Add moving document around

* Add document transform for tools

* Update to GraphiteEditor's fork

* Use write in foreach for rendering group / folder

* Add missing TranslateDown action

* Use points for line operation

* Format

* Add todo to change to shape's aspect ratio

* Remove empty if

* Initial pass at refactor

* Fix polyline test

* Use document message to modify document transform

* Messages -> Operations

* Transform layer

* Format

* Use DAffine2::IDENTITY

* Clean up kurbo generation for line and rect

* Use .into for rectangle points

* Rename cols to transform

* Rename other cols to transform

* Add todo for into_iter

* Remove unnecessary clone

Co-authored-by: akshay1992kalbhor <akshay1992kalbhor@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2021-06-26 21:44:48 +01:00
TrueDoctor
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
TrueDoctor
721a442b75 Use serde to serialize responses (#96) 2021-05-07 02:47:38 -07:00
T0mstone
53b34a9ad0
Polish a few things (#67)
* Improve some match statements using macros

* Use `thiserror` instead of manually impl'ing Error
2021-04-10 16:27:44 +02:00
T0mstone
5f565aeb74
Add proc macros for Hint and edge (#63)
* Add proc-macro crate with two macros

* Let cargo recalculate the Cargo.lock

* Add tests and refactor some code to allow testing

also the impl for parse_hint_helper_attrs now preserves order
(which is essential for testing)
2021-04-07 13:51:33 +02:00
George Atkinson
b88c246c87
Add FSM and related tool plumbing (Fix #54) (#62)
- Added FSM trait
- Added FSM to select and ellipse tools
- Moved circle stamping code to ellipse tool
2021-04-05 15:57:33 -07:00
TrueDoctor
593572a4e8
Add loging implementation for wasm (#56) 2021-03-30 18:48:32 +02:00
T0mstone
94f50377a3
Implement basic circle stamping (#53) 2021-03-29 01:44:34 +02:00
T0mstone
c437f1bd22
Add plumbing for event system (#52)
* Add plumbing for event system

* Apply review suggestions

* Add swap and reset color functions
2021-03-28 23:39:33 +02:00
ProTheory8
fde5f7e21f
Add metadata (#45)
* Add wasm-pack metadata
* Add Wasm tests directory
* Add basic Cargo manifest metadata
* Make web frontend unpublishable to npm
2021-03-27 11:16:05 +01:00
Keavon Chambers
7323d3cd21 Remove WebPack and let Vue CLI handle WASM. Project restructuring fixes. Add Vue SVG Loader. Fixes #29. 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
ProTheory8
018708791d Add init function to wasm-bindings crate and update dependencies (#33) 2021-03-27 02:26:54 -07:00
Keavon Chambers
df39091107 Add WASM bindings and web project structure 2021-03-27 02:26:54 -07:00
Keavon Chambers
bca97cbeff Shelve GUI system, set up new Rust project structure 2021-03-27 02:26:49 -07:00
Keavon Chambers
35ff5f55ea Add rustfmt.toml and enable auto formatting (Fixes #7) 2021-03-27 01:20:51 -07:00
Keavon Chambers
c0e092f726 Switch shader texture usage from sampler2D to texture2D plus sampler (fixes #1) 2020-07-11 19:01:48 -07:00
Keavon Chambers
0c7e6bc883 Implement abstract syntax tree parsing of XML layout 2020-05-27 04:08:52 -07:00
Keavon Chambers
f8025b15ea Add parsing of XML layout files into a ParsedLayoutNode tree 2020-05-25 22:08:27 -07:00
Keavon Chambers
a9859b4bb4 Refactor to generalize pipeline drawing sequence 2020-05-23 12:36:47 -07:00
Keavon Chambers
323a951362 Update wgpu from 0.4 to 0.5 (currently it's not rendering) 2020-05-02 14:44:28 -07:00
Keavon Chambers
b30ee294a6 Window with textured polygon 2020-04-26 00:28:13 -07:00