Commit graph

30 commits

Author SHA1 Message Date
Paul Kupper
6c14c5e04e Fix n-gon intersection (#342)
* Fix n-gon intersection

* Fix not all layers selected with box selection

* Code golf for TrueDoctor
2021-08-11 23:58:10 +02:00
Keavon Chambers
53ad105f57 Restructure project directories (#333)
`/client/web` -> `/frontend`
`/client/cli` -> *delete for now*
`/client/native` -> *delete for now*
`/core/editor` -> `/editor`
`/core/document` -> `/graphene`
`/core/renderer` -> `/charcoal`
`/core/proc-macro` -> `/proc-macros` *(now plural)*
2021-08-07 05:17:18 -07:00
TrueDoctor
699562b735 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
George Atkinson
d5c9821a02 Blend modes (#252)
* Add backend for selecting layer blend mode

* Change dropdown input to support callback on change

* Add debug messages

* Fix canvas update for blend-modes

* Finish up and polish blend modes implementations

* Add changes from code review

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2021-07-23 18:21:07 +01:00
Keavon Chambers
67131a23fd Remove CLI client stub 2021-07-15 03:44:57 -07:00
Till Arnold
94c42ff5d7 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-05 00:34:47 +02:00
0HyperCube
ece23e7c5f Remove partialeq for layers (#230)
# Conflicts:
#	Cargo.lock
#	core/document/Cargo.toml
2021-06-29 21:06:37 +01:00
0HyperCube
bb3293af43 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
4b19a459b7 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
f8ebff033d Use serde to serialize responses (#96) 2021-05-02 22:46:47 +02:00
T0mstone
21ffb3571e 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
09c4a1b796 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
0d6d6fb81b 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 23:57:33 +01:00
TrueDoctor
6050038047 Add loging implementation for wasm (#56) 2021-03-30 18:48:32 +02:00
T0mstone
d037e956e8 Implement basic circle stamping (#53) 2021-03-29 01:44:34 +02:00
T0mstone
5c13279d91 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
2f2bbb3a8b 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 15:16:05 +05:00
Keavon Chambers
fb5ce7e388 Remove WebPack and let Vue CLI handle WASM. Project restructuring fixes. Add Vue SVG Loader. Fixes #29. 2021-03-23 01:09:29 -07:00
TrueDoctor
d254916430 Define the js wasm-editor interface (#31) 2021-03-21 19:32:56 +01:00
TrueDoctor
1b8c71d2b3 Add graphite-editor library skeleton (#34) 2021-03-21 18:02:14 +01:00
ProTheory8
17a1043d07 Add init function to wasm-bindings crate and update dependencies (#33) 2021-03-19 22:57:18 +05:00
Keavon Chambers
0578e8f7c7 Add WASM bindings and web project structure 2021-02-14 18:46:08 -08:00
Keavon Chambers
e21bca41c6 Shelve GUI system, set up new Rust project structure 2021-02-14 17:57:17 -08:00
Keavon Chambers
848228dd45 Add rustfmt.toml and enable auto formatting (Fixes #7) 2020-07-12 16:20:28 -07:00
Keavon Chambers
642c7ffd00 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