Commit Graph
91 Commits
Author SHA1 Message Date
TrueDoctor e5564f87a8 Fix incorrect wasm mime type (#879) 2022-12-12 02:13:54 -08:00
TrueDoctor f1b7abede7 Bundle Graphite using Tauri (#873)
* Setup tauri component for graphite editor

Integrate graphite into tauri app

Split interpreted-executor out of graph-craft

* Add gpu execution node

* General Cleanup
2022-12-11 12:46:55 -08:00
TrueDoctor 6cc364b029 Implement node graph gpu execution via vulkano and rust gpu (#870)
* Add Executor abstraction

* Resolve inputs for proto nodes by adding compose nodes

* Add infrastructure for compiling gpu code

* Integrate nodegraph gpu execution into graph-crafter

* Extract graphene core path from env vars

* Make Color struct usable for gpu code
2022-12-05 12:56:36 +01:00
TrueDoctor 52048cb0d2 Implement Upcasting without nightly support (#825) 2022-10-25 16:37:18 -07:00
TrueDoctor a65ac7ddfd Node graph dynamic execution (#824)
Restructure document node implementation

* Implement topological sort

* Enforce the usage of type annotations

* Add complete test case
2022-10-25 15:45:42 -07:00
TrueDoctor 2873c8fb00 Relax borrow stack lifetimes (#823)
Relax lifetimes for borrow_stack
2022-10-25 15:35:30 -07:00
TrueDoctor 097899611f Implement node registry (#822) 2022-10-25 15:32:50 -07:00
TrueDoctor 06acd45a81 Rework DynAnyNode design to work with the borrow stack (#796) 2022-10-15 03:02:58 +02:00
TrueDoctor e3237b2c4e Implement the initial Document Nodes system (#795)
* Add testcase for flattening graph

* Implement equality for Values

* Implement input resolution
2022-10-15 02:02:50 +02:00
Dennis d566ba852d Impl DynNode 2022-08-23 14:02:50 -07:00
Dennis ce9e02f36d Make node trait consume self 2022-08-23 14:00:17 -07:00
Dennis fa0b896825 Implement image loding test 2022-08-23 14:00:17 -07:00
Dennis 7eb050092c Add tests for op nodes 2022-08-23 14:00:17 -07:00
Dennis abf04753e2 Implement cons node 2022-08-23 14:00:17 -07:00
Dennis a6a41c4b97 Add test for gray scale node
# Conflicts:
#	node-graph/gcore/src/raster.rs
2022-08-23 14:00:17 -07:00
Dennis 6b45927a60 Reintroduce input for the node trait
# Conflicts:
#	node-graph/gcore/src/raster.rs
2022-08-23 14:00:17 -07:00
Dennis 83ff548596 Add raster module to graphene_core 2022-08-05 17:43:49 -07:00
Dennis 9e1f4eb46d Add license information for node_graph crates 2022-08-04 11:47:38 +02:00
Dennis 5e9545322e Bump dyn-any version + format code 2022-08-04 09:08:48 +02:00
Dennis 30af1ba8db Integrate dyn-any into the main graphite repo 2022-08-04 09:05:19 +02:00
Dennis 4fd0042f9b Temporarily remove pretty printing for token streams 2022-08-02 11:53:35 +02:00
Dennis a348804908 Add dyn-any as a submodule 2022-08-02 11:52:08 +02:00
Dennis 089a3f5684 Compile node graph description to GPU code 2022-08-01 23:44:25 -07:00
Dennis 41a602bba9 Add Unit and Id nodes to node graph 2022-08-01 23:44:24 -07:00
Dennis 09f550bcd4 Don't force nodes to store references to other nodes 2022-08-01 23:44:22 -07:00
Dennis 4b8c0ec4e1 Remove input from the node definition 2022-08-01 23:44:19 -07:00
Dennis aa5e6f43f6 Add GPU support for node graph 2022-08-01 23:44:18 -07:00
Dennis bfe21cb179 Implement borrow stack for node graph 2022-08-01 23:44:16 -07:00
Dennis 1ae1fd5704 Make graphene_core no_std 2022-08-01 23:44:14 -07:00
Dennis 119e865007 Restructure node graph proxy architecture 2022-08-01 23:44:13 -07:00
Dennis 6349edfeb3 Replace GAT with lifetime on trait in node graph 2022-08-01 23:44:11 -07:00
Dennis 7384514b87 Try and fail to make nodes object-safe in node graph 2022-08-01 23:44:10 -07:00
Dennis fef173d3fe Restructure node graph project layout 2022-08-01 23:44:08 -07:00
Dennis 850ca7c73a Add Exec trait to simplify calling nodes without input data 2022-08-01 23:44:07 -07:00
Dennis a4542b20be Implement ProxyNode for node graph 2022-08-01 23:44:05 -07:00
Dennis 066b57f43e Add Fst- and SndNode to node graph 2022-08-01 23:44:03 -07:00
Dennis f58f2ee7ed Add FnNode and FnNodeWithState to node graph 2022-08-01 23:44:01 -07:00
Dennis 33244e7122 Finish implementation of compose node 2022-08-01 23:44:00 -07:00
Dennis 49aa948971 Rewrite node graph using generic associated types 2022-08-01 23:43:58 -07:00
Dennis 7a79a892b4 Implement node composition and Cache node 2022-08-01 23:43:56 -07:00
Dennis 4f492b24d2 Transition to a trait-based node graph 2022-08-01 23:43:54 -07:00
TrueDoctor 01bbe5dced Initial implementation of node graph based on structs 2022-08-01 23:43:42 -07:00
TrueDoctor bd5715d070 Differentiate between scale and dimensions (#570)
* Differentiate between scale and dimensions

* Fix layout and naming of properties
2022-03-26 17:48:40 -07:00
TrueDoctor 7daebef880 Fix type error in Brave browser (#569) 2022-03-15 19:10:45 +01:00
Dennis a276de255f Fix panic on non existing document layer 2022-02-16 17:41:45 +01:00
TrueDoctor 6d695a0a25 De duplicate Overlay render messages (#520) 2022-02-07 19:15:25 +01:00
TrueDoctor 9bb28def62 Simplify point storage for pen tool (#500)
Store points as vectors instead of representing them as transforms to
avoid confusion and improve efficiency
2022-01-27 18:49:49 +01:00
TrueDoctor b50bee9cf8 Generify functions in document.rs (#488)
* Generify functions in document.rs
2022-01-18 22:21:44 +01:00
TrueDoctorandOliver Davies aa9770092f Tidy up path handling in document_file (#464)
* Tidy up path handling in document_file

+ Improve #455

* Cargo Clippy lints

* Rename to_vec to map_to_vec

Co-authored-by: Oliver Davies <oliver@psyfer.io>
2022-01-06 19:15:08 -08:00
TrueDoctor 0e79dd4a46 Change the select tool to immediately start dragging when clicking a shape (#424)
* Change the select tool to immediately start dragging when clicking a shape

* Fix operation order

* Fix holding shift to add to selection
2021-12-28 14:05:02 +01:00
1eb83d92c4 Implement multiple clipboards (#425)
* Imeplement multiple Clipboards

* Cargo fmt

* Fix unit tests

* Fix console error caused by the Pen Tool (#432)

* Fix error in pen tool

* Cleanup

* Split make operation and remove preview

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Fix line centering (#431)

* cargo fmt

Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
2021-12-27 21:17:41 -08:00
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