Commit graph

324 commits

Author SHA1 Message Date
Dennis Kobert
307f6afbeb Remove http test from brush node 2023-05-27 09:06:51 +02:00
Dennis Kobert
b62ce1d03c Make node graph execution async
Make node macro generate async node implementations

Start propagating async through the node system

Async checkpoint

Make Any<'i> Send + Sync

Determine node io type using panic node

Fix types for raster_node macro

Finish porting node registry?

Fix lifetime errors

Remove Send + Sync requirements and start making node construction async

Async MVP

Fix tests

Clippy fix
2023-05-26 21:18:13 +02:00
0HyperCube
0c7b55949d Fix some node connection UI issues (#1248) 2023-05-26 18:02:05 +01:00
0HyperCube
15eb4df8d4 Add the document graph (#1217)
* Thumbnails for the layer node

* Raster node graph frames

* Downscale to a random resolution

* Cleanup and bug fixes

* Generate paths before duplicating outputs

* Fix stable id test

* Add a document node graph

* Fix merge conflict

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-05-26 17:22:58 +01:00
Orson Peters
41f7ce0bb3 Added commands for easier profiling. (#1236) 2023-05-25 12:03:12 +02:00
Dennis Kobert
5816807f18 Decouple node graph execution (#1209)
* Decouple node graph execution from the main loop

* Trigger document Render + Layer updates after the graph evaluation
2023-05-25 10:36:56 +02:00
0HyperCube
6400953af5 Thumbnails for the layer node (#1210)
* Thumbnails for the layer node

* Raster node graph frames

* Downscale to a random resolution

* Cleanup and bug fixes

* Generate paths before duplicating outputs

* Fix stable id test

* Code review changes

* Code review pass with minor changes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-05-18 05:12:50 +01:00
Chase
05f58f4ca1 Allow right clicking in text fields (#1207)
* Allow right clicking in text edit

* Cleanup

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-05-12 13:55:03 +08:00
0HyperCube
4e0c673a35 Add Layer and Artboard node definitions and underlying data structures (#1204)
* Add basic node defenitions

* Code review

* change widget code

* Artboard node changes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-05-09 21:57:22 +01:00
Chase
7e1b452757 Add color choices to the options bar of tools (#1199)
* Generalize PenColorType -> ToolColorType

* impl default for ToolColorOptions

* Add stroke color option to the freehand tool

* Consolidate working color update messages

* Update tool working colours when switching tools

* Update working colors on tool activation

* Add stroke color option to line tool

* Add fill color option to freehand tool

* Add tool color options to spline tool

* Fix freehand tool

* Add color options to text

* Add tool color/weight options to rectangle

* Add tool color/weight options to ellipse

* Add tool color/weight options to shape

* Fix spline default fill/stroke

* Reorder widgets and code cleanup

* Add CustomColor icon

* Fix warnings

* Change color defaults to secondary fill, primary stroke

* Fix spacing between brush options number inputs

* Add toolbar color option to brush

* Implement allowNone on color input widget

* Rearrange widget and remove X from brush

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-05-08 18:00:10 +08:00
Dennis Kobert
3adcc3031a Implement Infrastructure to reuse previous frames for brush drawing
Implement Infrastructuro to reuse the previous evaluation of the
node graph to blend the new stroke with instead of drawing the
entire trace from scratch.
This does not transition to a blending based approach because that still
caused regressions but allows the brush node to work with input data
natively.

Test Plan:
- Use the brush tool in the editor and check for regressions
- Evaluate the performance

Reviewers: Keavon

Pull Request: https://github.com/GraphiteEditor/Graphite/pull/1190
2023-05-03 13:14:41 +02:00
Keavon Chambers
ebf67eaa82 Implement download/copy ImageFrame layer output (#1194)
* Implement download/copy ImageFrame layer output

* Add note about black transparency when copying

* Introspect node graph output type to conditionally disable the download button

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2023-05-03 02:09:07 -07:00
Chase
1aaf2a521b Add fill and stroke color choices to the Pen tool options bar (#1188)
* Add basic layout - WIP

* Add color input min-width -> 80px

* First pass implementation - WIP

* Allow fill to be None

* Fix null Fill color

* refactor fill and stroke options into struct

* toolbar progress - WIP

* Switch is_working_color bool to PenColorType enum

* Add todo

* Add WorkingColorChanged event

* remove unused import

* Add WorkingColor[Primary/Secondary] icons

* Allow new strokes to have no color

* Set to base color when X is pressed (as per req)

* Improve icons for new UI layout design

* Add radio buttons

* Fix menu bar Edit12px -> Edit

* Add tooltips to radio buttons

* Make the color selector only on custom

* Fix edit icon correctly this time (whoops)

* Fix working colors icons

* Changes to improve the UX

* Remove lines obviated by Default::default()

* Make Eyedropper tool use working_color_changed event

* Fix tests

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-05-03 02:08:35 +08:00
Keavon Chambers
0bd96bee1d Reduce height of NumberInput slider thumb 2023-04-28 18:14:47 -07:00
Dennis Kobert
1020eb6835 Implement the Brush without relying on a stamp texture
Test Plan: Test the BrushNode in the editor

Reviewers: Keavon

Reviewed By: Keavon

Pull Request: https://github.com/GraphiteEditor/Graphite/pull/1184
2023-04-29 01:31:14 +02:00
iacore
5d9c0cb4d5 Upgrade npm dependencies and add "@parcel/config-default" (#1160)
"@parcel/config-default" is needed to run on other package managers like pnpm even though it seems to have worked okay on regular npm.

* Upgrade and fix frontend dependencies

* More dep updates

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-04-28 18:36:32 +00:00
Keavon Chambers
dcabd6c0b4 Refactor naming to deprecate "node graph frame" terminology (#1187) 2023-04-28 01:30:47 -07:00
Dennis Kobert
bea7cc8dd0 Add node introspection API
Closes #1110

Test Plan: query the introspectNode Endpoint from js

Reviewers: 

Pull Request: https://github.com/GraphiteEditor/Graphite/pull/1183
2023-04-28 00:20:39 +02:00
Keavon Chambers
0af42ee6f9 Prevent closing the crash dialog
Closes #1115
2023-04-27 13:37:39 -07:00
Keavon Chambers
44c26f1570 Fix MenuList submenu reachability on hover and other styling 2023-04-27 13:08:33 -07:00
Keavon Chambers
1f5bfdc2e5 Minor UI design style revamp 2023-04-27 02:05:45 -07:00
0HyperCube
ef93f8442a Migrate text layers to nodes (#1155)
* Initial work towards text to node

* Add the text generate node

* Implement live edit

* Fix merge error

* Cleanup text tool

* Implement text

* Fix transforms

* Fix broken image frame

* Double click to edit text

* Fix rendering text on load

* Moving whilst editing

* Better text properties

* Prevent changing vector when there is a Text node

* Push node api

* Use node fn macro

* Stable ids

* Image module as a seperate file

* Explain check for "Input Frame" node

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-04-27 03:07:43 +01:00
Dennis Kobert
e6216009ee Migrate build system from Webpack to Parcel (#1102)
* Migrate webpack to parcel

* Always colour shell output

* Fix typos

* Fix updateImage function having undefined editorInstance

* Readd webpack for deployment builds (licence checker)

* Only use webpack for license generation

* Re add typscript support

* Fix cloudlare deploy

* Bump wasm-pack version

* Update ci script

* Print versions in ci script

* Use optional-dependencies for wasm-pack

* Execute wget after rust install

* Finding wasm-opt version

* Print wasm-opt version

* Revert test?

* Try to revert

* Deploy cloudflare via github actions

* Fix indentation in ci script

* Change project to graphite-dev

* Trigger ci

* Parcel ci (#1152)

* CI Test

* Add write permissions for pr

* Manually add cloudflare ci comment to prs

* Unskip cargo about

* Make compile on new versions of npm

* Add deployment script to rebuild editor.graphite.rs on tag creation

* Remove deploy script

* Comment out unused Svelte props causing warnings

* Many small fixes, including fixing @ imports

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-04-25 00:43:27 +02:00
Keavon Chambers
9db5ad43bf Add the Channel Mixer node (#1142)
* Add the Channel Mixer node

* Fix NodeIdentifier not found in Registry

* Add radio toggle for red/green/blue

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2023-04-17 12:47:24 -07:00
0HyperCube
ed6140b4a7 Brush tool live preview (#1116)
* Disable vector preview for brush tool

* Fix brush preview

* Fix warping

* Left and right square brackets to change size

* Add linear interpolation

* Modfiy existing selected brush layer

* Resolve warnings

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-04-12 18:50:42 +01:00
Keavon Chambers
c16ee88b5d Fix some fatal failures related to rendered frame memory size limits 2023-04-02 18:31:41 -07:00
Keavon Chambers
a74376e224 Prevent browser extensions from recoloring the UI 2023-04-04 18:32:27 -07:00
Keavon Chambers
a0a5f02e2a Change the edit icon used in Imaginate 2023-04-03 14:16:46 -07:00
Keavon Chambers
0a9427fe6e Polish node graph frames and rename them for clarity (#1104)
* Polish layer panel UI and layer type icons/text

* Assorted UI text and comment cleanup

* Insert Transform node before Imaginate node via tool

* Rename "Node Graph Frame" to Layer type and Frame tool

* Rename "Node Graph Frame" to "Frame" tool

* Update Node Graph Frame -> Frame tool icon

* Fix lint warnings
2023-04-03 01:52:25 -07:00
0HyperCube
d710285029 Fix regressions introduced in the vector nodes migration (#1100)
* Fix double click to enter path tool

* Fix error

* Fix transform bug

* Fix squaring scale on images

* Shift node position and refresh graph

* Downscale node seperate

* Fix mirror

* Remove duplicate transform

* Always show node graph

* Correctly set freehand and spline tool positions

* Run cargo format

* Maybe fix the scale

* Downscaled image is always smaller than origional

* Fix one crash

* Don't show node graph on welcome screen

* Reduce default graph panel height

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-03-31 21:15:49 +01:00
Keavon Chambers
92fe0bea50 Bezier-rs: Replace Vue-CLI with Webpack bundler 2023-03-29 16:58:51 -07:00
Andre Roelofs
639a24d8ad Replace TS relative @ import path (#1087)
Migrated the import shortcut used in Svelte from @ to @graphite for better future package compatibility

Co-authored-by: Andre Roelofs <andreroelofsai@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-03-26 01:39:38 +01:00
Keavon Chambers
bfbabbc4dc Fix remaining known Svelte UI regressions
Closes #1040
2023-03-20 21:26:33 -07:00
0HyperCube
fb6ca73808 Make image downscaling have a configurable factor (#1044)
Remove downscaling
2023-03-12 06:42:44 +00:00
Keavon Chambers
29af355f20 Fix Eyedropper tool and make Svelte's bind:this more robust 2023-03-11 12:32:01 -08:00
Keavon Chambers
5748d9bff4 Assorted code file cleanup following Svelte switch 2023-03-10 15:48:04 -08:00
Keavon Chambers
74d761dc84 Remove all references to Vue 2023-03-10 04:02:02 -08:00
Keavon Chambers
6e20ea538b Replace the Vue frontend with Svelte 2023-03-10 03:54:39 -08:00
Keavon Chambers
e539e43483 Rename .vue files to .svelte for diffing 2023-03-10 03:53:15 -08:00
Keavon Chambers
2327524690 Move JS script to the top of each Vue file 2023-03-10 03:44:49 -08:00
Keavon Chambers
7ce9d6db05 Fix FieldInput and several other Svelte bugs 2023-03-08 01:35:22 -08:00
Keavon Chambers
c8a7e58bd5 Add double click input hint icons 2023-03-05 17:49:47 -08:00
Dennis Kobert
b55e233fff Update GPU execution and quantization to new node system (#1070)
* Update GPU and quantization to new node system

Squashed commit of the following:

commit 3b69bdafed79f0bb1279609537a8eeead3f06830
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Sun Mar 5 11:37:17 2023 +0100

    Disable dev tools by default

commit dbbbedd68e48d1162442574ad8877c9922d40e4a
Merge: b1018eb5 a8f6e11e
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Sun Mar 5 10:45:00 2023 +0100

    Merge branch 'vite' into tauri-restructure-lite

commit b1018eb5ee56c2d23f9d5a4f034608ec684bd746
Merge: 3195833e 0512cb24
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Fri Mar 3 17:06:21 2023 +0100

    Merge branch 'master' into tauri-restructure-lite

commit 3195833e4088a4ed7984955c72617b27b7e39bfc
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Fri Mar 3 17:06:02 2023 +0100

    Bump number of samples

commit 3e57e1e3280759cf4f75726635e31d2b8e9387f9
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Fri Mar 3 16:55:52 2023 +0100

    Move part of quantization code to gcore

commit 10c15b0bc6ffb51e2bf2d94cd4eb0e24d761fb6f
Merge: 2b3db45a 8fe8896c
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Fri Mar 3 14:28:56 2023 +0100

    Merge remote-tracking branch 'origin/master' into tauri-restructure-lite

commit 2b3db45aee44a20660f0b1204666bb81e5a7e4b6
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Fri Mar 3 14:17:11 2023 +0100

    Fix types in node registry

commit 9122f35c0ba9a86255709680d744a48d3c7dcac4
Merge: 26eefc43 2cf4ee0f
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Fri Mar 3 01:04:55 2023 +0100

    Merge remote-tracking branch 'origin/master' into tauri-restructure-lite

commit 26eefc437eaad873f8d38fdb1fae0a1e3ec189e4
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Thu Mar 2 23:05:53 2023 +0100

    Add Quantize node to document_node_types

commit 3f7606a91329200b2c025010d4a0cffee840a11c
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Thu Mar 2 17:47:51 2023 +0100

    Add quantization nodes to node registry

commit 22d8e477ef79eef5b57b1dc9805e41bbf81cae43
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Thu Mar 2 17:13:28 2023 +0100

    Introduce scopes (#1053)

    * Implement let binding

    * Add lambda inputs

    * Fix tests

    * Fix proto network formatting

    * Generate a template Scoped network by default

    * Add comment to explain the lambda parameter

    * Move binding wrapping out of the template

    * Fix errors cause by image frames

commit 9e0c29d92a164d4a4063e93480e1e289ef5243fe
Author: Alexandru Ică <alexandru@seyhanlee.com>
Date:   Thu Mar 2 15:55:10 2023 +0200

    Make use of ImageFrame in the node system more extensively (#1055) (#1062)

    Make the node system use ImageFrame more extensively (#1055)

commit 5912ef9a1a807917eeb90c1f4835bd8a5de9c821
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Wed Mar 1 16:15:21 2023 +0100

    Split quantization into multiple nodes

commit 285d7b76c176b3e2679ea24eecb38ef867a79f3b
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Mon Feb 27 12:35:57 2023 +0100

    Fix gpu support

commit e0b6327eebba8caf7545c4fedc6670abc4c3652e
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Thu Feb 16 22:08:53 2023 +0100

    Don't watch frontend files when using tauri

commit 58ae146f6da935cfd37afbd25e1c331b615252da
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Thu Feb 16 21:48:54 2023 +0100

    Migrate vue code base to vite

commit f996390cc312618a60f98ccb9cd515f1bae5006d
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Thu Feb 16 19:34:33 2023 +0100

    Start migrating vue to use vite

commit 29d752f47cfd1c74ee51fac6f3d75557a378471c
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Thu Feb 16 19:00:53 2023 +0100

    Kill cargo watch process automatically

commit 4d1c76b07acadbf609dbab7d57d9a7769b81d4b5
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Thu Feb 16 17:37:27 2023 +0100

    Start playing around with vite infrastructure

commit 8494f5e9227aa433fd5ca75b268a6a96b2706b36
Author: Locria Cyber <74560659+locriacyber@users.noreply.github.com>
Date:   Thu Jan 19 18:40:46 2023 +0000

    Fix import style and eslint rules

commit 92490f7774a7351bb40091bcec78f79c28704768
Author: Locria Cyber <74560659+locriacyber@users.noreply.github.com>
Date:   Thu Jan 19 18:25:09 2023 +0000

    Fix icons

commit dc67821abad87f8ff780b12ae96668af2f7bb355
Author: Locria Cyber <74560659+locriacyber@users.noreply.github.com>
Date:   Thu Jan 19 18:20:48 2023 +0000

    Add license generator with rollup

commit 441e339d31b76dac4f91321d39a39900b5a79bc1
Author: Locria Cyber <74560659+locriacyber@users.noreply.github.com>
Date:   Thu Jan 19 18:14:22 2023 +0000

    Use eslint --fix to fix TS-in-svelte type imports. Now it compiles.

commit 2e847d339e7dcd51ed4c4677ed337c1e20636724
Author: Locria Cyber <74560659+locriacyber@users.noreply.github.com>
Date:   Thu Jan 19 17:31:49 2023 +0000

    Remove webpack and plugins

commit 3adab1b7f40ff17b91163e7ca47a403ef3c02fbc
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Thu Mar 2 16:10:19 2023 +0100

    Fix errors cause by image frames

commit 4e5f838995e213b4696225a473b9c56c0084e7a8
Author: Alexandru Ică <alexandru@seyhanlee.com>
Date:   Thu Mar 2 15:55:10 2023 +0200

    Make use of ImageFrame in the node system more extensively (#1055) (#1062)

    Make the node system use ImageFrame more extensively (#1055)

commit 1d4b0e29c693a53c068f1a30f0e857a9c1a59587
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Wed Mar 1 15:13:51 2023 +0100

    Update node graph guide readme with new syntax (#1061)

commit 6735d8c61f5709e22d2b22abd037bab417e868d6
Author: Rob Nadal <Robnadal44@gmail.com>
Date:   Tue Feb 28 18:59:06 2023 -0500

    Bezier-rs: Add function to smoothly join bezier curves (#1037)

    * Added bezier join

    * Stylistic changes per review

commit cd1d7aa7fbcce39fbbf7762d131ee16ad9cb46dd
Author: Dennis Kobert <dennis@kobert.dev>
Date:   Wed Feb 22 23:42:32 2023 +0100

    Implement let binding

    Add lambda inputs

    Fix tests

    Fix proto network formatting

    Generate a template Scoped network by default

    Add comment to explain the lambda parameter

    Move binding wrapping out of the template

* Update package-lock.json

* Regenerate package-lock.json and fix lint errors

* Readd git keep dir

* Revert change to panic.ts

* Fix clippy warnings

* Apply code review

* Clean up node_registry

* Fix test / spriv -> spirv typos
2023-03-05 13:22:14 +01:00
Keavon Chambers
6139e807d0 Fix graph scrolling bug from #1021
And replicate those changes to the Svelte version.
2023-03-03 02:28:52 -08:00
multisn8
7a52e50a94 Add 'Zoom with Scroll' input navigation scheme to preferences (#1021)
* Add use_scroll_as_zoom field to preference handler

* Add {Create,Delete}Mapping variants to message

* Revert "Add {Create,Delete}Mapping variants to message"

This reverts commit 0ba74754c9fb0c78d0b590c96e1d4fe2cfdd13e7.

* Revert "Add use_scroll_as_zoom field to preference handler"

This reverts commit d30f7c9edfa6d6e156939ca07f4db81f288975fd.

* Add basic scroll_as_zoom mapping

* Create overengineered mapping patch abstraction

* Add (for now passthrough) input layout manager

* Actually handle ModifyLayout messages (untested)

* Add backend preferences <-> layout manager comms

* Add scroll-as-zoom to actual preferences UI

* Rename LayoutManager -> KeyMapping

* Add Input section to preferences and title case

* Add scrollAsZoom frontend handling code (untested)

* Handle frontend <-> preferences comms

* (broken) Move scrollAsZoom persistence into state

* Fix scrollAsZoom having no effect on node graph

* Remove debugging helpers

* Fix confusion between horizontal and vertical

* Rename feature

* Move new message handler into folder

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-24 07:18:04 +01:00
Dennis Kobert
63b9b670a1 Change tauri build directory back to ../dist (#1033) 2023-02-16 15:43:21 +01:00
Keavon Chambers
f0ad4c91d3 Replace "Edit" icon with final version 2023-02-12 20:02:15 -08:00
Keavon Chambers
33b5c0f5f4 Svelte: Fix FontInput component infinite loop 2023-02-12 01:01:40 -08:00
0HyperCube
1b0e1b9bdf Update Imaginate to output bitmap data to the graph via Image Frame node (#1001)
* Multiple node outputs

* Add new nodes

* gcore use std by default to allow for testing

* Allow multiple node outputs

* Multiple outputs to frontend

* Add ImageFrameNode to node registry

* Minor cleanup

* Basic transform implementation

* Add some logging to image encoding

* Fix ImageFrameNode

* Add transform input to Imaginate node (#1014)

* Add transform input to imaginate node

* Force the resolution to be edited with no transform

* Add transform to imaginate generation

* Fix compilation

---------

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

* Add labels to node outputs

* Fix seed; disable mask when transform is disconnected; add Imaginate tooltips

* Rename 'Input Multiple' node to 'Input'

* Code review

* Replicate to Svelte

* Show only the primary input chain in the Properties panel

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-11 08:56:31 +00:00
Keavon Chambers
d456640bb8 Fix regressions in previous PR 2023-02-09 11:53:14 -08:00