Commit graph

2382 commits

Author SHA1 Message Date
isiko
99d15df1e0 Add some Improvements to Mask Node (#1233)
These Improvements were proposed by nat-rix for PR #1153 but also apply to the Mask Node
2023-05-25 11:26:16 +02:00
Orson Peters
bb93d243a0 Optimize colorspace conversion (#1228)
* Enabled cross-crate inlining for release builds.

* Sprinkled inline-enabling directives in color.rs.

* Reduced abstraction in color channel handling for better inlining.

* Alpha should not use gamma.

* Oops, didn't compile.

* Added discrete sRGB <-> linear float conversion.

* Use new float <-> sRGB conversion.

* Improved comments.

* Don't convert fully transparent pixels.
2023-05-25 10:51:40 +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
Shouvik Ghosh
da6261aa75 Delete handle on dragging it into its anchor (#1202)
* Delete handles when dragged to anchor + create mirror handle even if handle is deleted

* Handle different zoom levels + check handle mirroring for removal

* Handle different zoom levels + check handle mirroring for removal

* Add an anchor check

* Code review changes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-05-20 12:27:48 +05:30
Chase
1039f76502 Fix node copy paste issues (#1208)
* Fix copy issue

* Allow copying of input frame nodes

* Fix duplication delay of node graphs

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-05-20 03:08:59 +08:00
Christopher Mendoza
bb1e7c44cf Make duplicating folders also duplicate its children (#1178)
* Latest changes

* Add layer attempt

* layer tree is now correct after duplicating layers

* Latest changes

* Latest Changes

* Recursive idea

* Moving Layers to Dup Folder - not done

* latest changes

* latest progress

* Latest Changes

* Latest Changes

* Latest Changes

* Latest

* Latest

* Latest

* Duplicating Folders works

* Initial Refactoring

* Ready for QA

* Doesn't select all the children after duplicate anymore

* First pass code review with major cleanup

* Removed unused next_asssignment_id function and updated FolderLayer struct

* Removed unused logic

* First iteration of cleaning up the code

* Added Ollie's suggestions

* Code review cleanup

---------

Co-authored-by: Ollie Dolan <olliedolan10@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-05-19 00:41:16 -07: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
Rottie
727e5bdeb1 Replace Fill node's "Use Gradient"/"Use Solid" buttons with toggle (#1220)
* Replace Fill node's Use Gradient\Solid Color with radio selector

* Code Review Round 1

* Code Review Final Round ?
2023-05-17 18:01:13 +00: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
0HyperCube
ab2de96640 Fix brush layers growing hugely when resizing transforms with Select tool (#1201)
* Fix brush tool resize

* Fix typo

* Fix image transforms

* Remove input from image network

* Fix merge error

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-05-07 12:17:12 +01:00
0HyperCube
d7c5658852 Imaginate fixes (#1200) 2023-05-07 11:23:16 +01:00
Keavon Chambers
c79cf41c28 Show outline for image frames on hover and when selected with frame tools 2023-05-07 01:30:16 -07:00
Keavon Chambers
59adf9a032 Remove dead code from document-legacy 2023-05-06 17:03:40 -07:00
Dennis Kobert
47f9f7621e Fix "Failed to execute" dialog showing up at times (#1196)
[𝘀𝗽𝗿] initial version

Created using spr 1.3.4
2023-05-03 19:39:02 +02:00
Dennis Kobert
36f24b7730 Implement bounds input to constrain the output frame of the brush node
Test Plan:
Hook up a constraint to the brush node in the editor and
verify the result looks correct

Reviewers: 

Pull Request: https://github.com/GraphiteEditor/Graphite/pull/1195
2023-05-03 17:05:04 +02: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
Dennis Kobert
cef1cf7587 Hide edge aliasing of hard brushes with a blur (#1189)
* [𝘀𝗽𝗿] initial version

Created using spr 1.3.4

* Formatting

Created using spr 1.3.4

* Rename aa to blur + add comment

Created using spr 1.3.4
2023-04-29 23:35:30 +02: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
Keavon Chambers
3f17207a32 Replace responses.push() with responses.add() everywhere (#1186) 2023-04-27 17:25:19 -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
Chase
0bac707241 Fix #1174: Spline does not have mirror handles enabled (#1182)
* Set spline mirror handles to enabled by default

* refactor mirror setting into common function

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-04-27 19:21:20 +08:00
Keavon Chambers
1f5bfdc2e5 Minor UI design style revamp 2023-04-27 02:05:45 -07:00
Dennis Kobert
a4793fb284 Implement source maps between proto/document nodes
Add the node path to the document node and carry that over to the proto
nodes which are generated from that.
This pr also adds a compiler pass to assign the paths based on the
hierarchical structure of the nodegraph.

Test Plan: - Run units tests which check the path propagation works

Reviewers: Keavon

Reviewed By: Keavon

Pull Request: https://github.com/GraphiteEditor/Graphite/pull/1181
2023-04-27 11:02:04 +02: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
271f9d5158 Add monitor node for graph introspection
Adds a `serialize` function on Node which can be implemented by nodes to
allow introspecting their content. This pr also adds a Monitor Node that
always caches the last value it was evaluated with.

Test Plan: -

Reviewers: 0HyperCube

Reviewed By: 0HyperCube

Pull Request: https://github.com/GraphiteEditor/Graphite/pull/1165
2023-04-26 23:21:50 +02:00
Dennis Kobert
9cf93a9156 Run CI for non-master pushes/PRs
Disables the requirement of merging into master to run the ci.

Test Plan:
- Create a pr against a non master branch and verify the ci runs
    - Push to a non master branch and verify the ci runs

Reviewers: Keavon

Reviewed By: Keavon

Pull Request: https://github.com/GraphiteEditor/Graphite/pull/1166
2023-04-26 19:37:49 +02:00
Dennis Kobert
c61ea003a7 Continue execution of ci script if posting a comment fails
Test Plan:
Create PR run for forked repo and see if the CI still finishes even if
the commment creation fails

Reviewers:

Pull Request: https://github.com/GraphiteEditor/Graphite/pull/1164
2023-04-26 11:59:19 +02:00
Keavon Chambers
d8dfcb28ac Add cargo-watch installation to build instructions on website 2023-04-25 23:35:12 -07:00
Dennis Kobert
73a9beaf5e Readd alias package.json 2023-04-25 00:58:53 +02: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
nat-rix
c814abc347 Fix too many locals in wasm binary (#1159)
Split function into smaller non-inlinable ones

this fixes the issue that rust creates too many wasm locals in non-optimized
builds. That lead to a compile error in such builds.

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-04-24 21:44:06 +02:00
Dennis Kobert
00fd701f66 Enable optimization for the interpreted-executor crate
Enables optimizations for `interpreted-executor` in debug mode to
circumvent the wasm limit for the number of locals in a single function.

Test Plan:
Add entries to the node registry and verify that it does
still compile

Reviewers: Keavon

Reviewed By: Keavon

Pull Request: https://github.com/GraphiteEditor/Graphite/pull/1158
2023-04-24 20:04:46 +02:00
Dennis Kobert
497bf3dfc5 Fix ordering of MaskNode Trait Bounds
Test Plan: -

Reviewers: 

Pull Request: https://github.com/GraphiteEditor/Graphite/pull/1157
2023-04-24 20:02:45 +02:00
Dennis Kobert
366906b956 Add Luma struct (#1154)
* Make Luma usable for MaskImageNode
2023-04-23 19:42:34 +02:00
Dennis Kobert
bdc1ef926a Restructure GPU execution to model GPU pipelines in the node graph (#1088)
* Start implementing GpuExecutor for wgpu

* Implement read_output_buffer function

* Implement extraction node in the compiler

* Generate type annotations during shader compilation

* Start adding node wrapprs for graph execution api

* Wrap more of the api in nodes

* Restructure Pipeline to accept arbitrary shader inputs

* Adapt nodes to new trait definitions

* Start implementing gpu-compiler trait

* Adapt shader generation

* Hardstuck on pointer casts

* Pass nodes as references in gpu code to avoid zsts

* Update gcore to compile on the gpu

* Fix color doc tests

* Impl Node for node refs
2023-04-23 10:18:31 +02:00
Keavon Chambers
161bbc62b4 Add the Selective Color adjustment node 2023-04-19 03:02:50 -07:00
Dennis Kobert
76c754d38a Simplify node trait definition (#1146)
* Simplify node trait
2023-04-17 23:42:22 +02:00
Dennis Kobert
1d6c4f13dd Bump version of dyn-any to address missues which could lead to ub (#1145)
* Make StaticType trait unsafe

* Mark StaticTypeSized and StaticTypeClone as unsafe as well

* Update dyn-any dependency

* Update manifest links
2023-04-17 23:35:04 +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
Dennis Kobert
a1b63811ba Impl byte size function for Color (#1141) 2023-04-17 09:58:21 +02:00
OllieDolan
974a37f127 Path tool points manipulation: nudging, drag axis snapping, and G/R/S (#1068)
* issue820: implemented nudging points

* nudge points triggered only when the mouse is moved after selecting one point

* issue 820 // bullet 1 done

* grab working / rotate not

* rotate works (sensitive)

* G/R/S and Shift/Drag working

* Cargo formatted // implemented Hypercubes comments

* Refactored G/R/S - need to fix fast transform

* Finished refactored G/R/S

* Typed Angle needs further touch up

* Cargo formatted

* Dealt with dangerous unwraps

* Cargo fmt (again) - unwraps fixed

* Cleaned up

* cargo fmt

* Ready for Review

* Ready for Review- cargo fmt

* Code review fixes

* Remove duplicate constant for nudging

* Fix consts.rs spacing

* Apply suggestions from code review

Added suggestions

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

* Added typo/grammar suggestions

* Nits

---------

Co-authored-by: Shiro <shiro@damedane.local>
Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-04-16 15:56:52 -07:00