Commit graph

381 commits

Author SHA1 Message Date
Keavon Chambers
b30488bbb7
Add support for handling MMB/RMB double click inputs (#1407)
* Add support for handling MMB/RMB double click inputs

* Add todo comment

* Enforce types

---------

Co-authored-by: 0hypercube <0hypercube@gmail.com>
2023-09-01 14:57:03 -07:00
Keavon Chambers
a112ab27cf
Dialog redesign and content revamp (#1409)
* Revamp the content and design of dialogs

* Add the Licenses dialog
2023-09-01 01:58:20 -07:00
0HyperCube
e77782aadb
Remove console spam (#1400)
* Remove console spam

* CSS Style

* Slight cleanup

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-08-27 16:12:32 -07:00
Keavon Chambers
cc0192977d Add demo artwork open links to website 2023-08-22 03:41:19 -07:00
Keavon Chambers
0dcfafbf64 Add demo artwork 2023-08-22 03:26:59 -07:00
Keavon Chambers
0e97a256b7 Fix node colors; fix spacebar not closing graph 2023-08-20 23:32:27 -07:00
Keavon Chambers
980b692d46 Fix graph view button hotkey tooltip; fix layer CSS bug 2023-08-19 17:04:09 -07:00
Keavon Chambers
185106132d Move node graph from panel to overlay on viewport 2023-08-19 01:21:37 -07:00
Keavon Chambers
5a7d230156 Improve the layers UI in the node graph 2023-08-18 14:26:59 -07:00
nat-rix
dc4b16aead
Curves image adjustment node (#1214)
* Create ValueMapperNode and use it for brightness/contrast

* move spline code into seperate module

* Add GenerateCurvesNode

* add a `LuminanceMut`-trait
* add `lerp` to `Channel`

* Add frontend code to handle the curves widget's inputs

* Rename spline module to curve

* Make messages in CurveInput pass

* Improve curves widget design and fix sizing issue

* Implement proper bezier handling

* Use bezier_rs's intersections function instead of own cubic root solver

* Debounce CurveInput events and change how debouncer works

the first event issued to the debouncer was unneccessarily delayed.
Instead now the debouncer fires it instantaneously but blocks events
that come in until a timeout was reached.

* Make curve editing more user friendly

* Change code to use project terminology

* sample -> manipulator group or manipulator
* marker -> handle

* Fix small documentation mistake in bezier-rs

* Add find_tvalues_for_x function to bezier-rs

also integrate the function into curves node

* Add tests for find_tvalues_for_x in bezier-rs

* Fix formatting

* Revert BrightnessContrastNode changes

* Frontend cleanup

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2023-08-13 01:07:11 -07:00
Keavon Chambers
f429db6369 Revamp the Graphite website (#1265)
Revamp the website with more content
2023-08-10 18:37:04 -07:00
Keavon Chambers
f2b0abc164 Roll back node dragging smoothing for now due to wire visual bugs 2023-08-09 01:10:35 -07:00
Keavon Chambers
c653fe9579 Add a few node graph style improvements
Also add smoothing to node dragging
2023-08-05 00:55:19 -07:00
Keavon Chambers
3450d638a6
Layer-based nodes redesign, just the basics so far (#1362)
* Redesign the nodes

* Basic vertical stacking syntax sugar

* Fix node connections

* Primary output and line thickness

---------

Co-authored-by: 0hypercube <0hypercube@gmail.com>
2023-08-04 14:56:00 -07:00
Keavon Chambers
a267582b4c Fix tool shelf's scrollbar layout shift
Caused by Chromium 113 removing `overflow: overlay;`.
This fixes it for just the tool shelf.
2023-08-03 23:33:24 -07:00
Keavon Chambers
2b05e1c270 Rename Shape tool to Polygon tool 2023-08-01 01:28:14 -07:00
Keavon Chambers
9d425db5a4 Rename "Layer Tree" panel to "Layers" 2023-07-28 17:00:06 -07:00
0HyperCube
08f9be6aaf Artboard nodes (#1328)
* Create artboard nodes

* Update node when resizing artboard

* Render clipped artboards

* More stable feature

* Do not render old artboards

* Fix some issues with transforms

* Fix crash when drawing rectangle

* Format

* Allow renaming document from Properties panel

* Adjust artboard label styling

* Fix document graph refresh so artboards show up

* Make "Clear Artboards" coming soon

* Fix displaying an infinite canvas

* Show document name in node graph options bar

* info!() to debug!()

* Fix Properties panel not being cleared when all docs closed

* Remove dead code

* Remove debug logs added in this branch

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-07-27 07:35:17 +01:00
0HyperCube
acb46bc1d3 Fix missing popover text (#1329) 2023-07-19 22:04:48 +01:00
0HyperCube
80cc5bee73 Fix clippy lints (#1327)
* Fix clippy lints

* Update formatting

* Remove unsafe send impls

* New type for Rc<NodeContainer>
2023-07-19 16:38:23 +01:00
Dhruv
743803ce04 Add Snapping Options to the Snap Dropdown Menu (#1321)
* [wip]feat: add snapping options

* [wip]fix: use svelte component for optionsWidget

* fix: use apt PopoverButton types

* refactor: minor formatting improvements

* Fix popover layout

* [wip]feat: attempt implementing CheckboxInputData struct

* fix: use correct Checkbox struct 's default method

* fix: revert adding CheckboxInputData struct

- This reverts commit 2a481887fc.

* feat: use checkboxes for snapping options

* feat: add label to dropdown checkbox elements

* fix: separate Snap dropdown menu elements
- move each element into separate row

* [wip]feat: modularize snapping states
- maintain individual snapping states for document

* fix: snapping checkboxes' behavior
- checkboxes now update internal snapping state

* refactor: update snap states individually
- this prevents out-of-sync states
- enables reusing existing snap state object

* feat: snap to boxes and nodes conditionally

* [wip]feat: attempt to invert checkbox on update
- attempt implementing mutable WidgetCallback struct
- attempt using above struct to invert checkbox state on update

* Fix widget diffing

* refactor: remove unused code

* feat: align checkboxes consistently with labels

* feat: use separators to stylize snapping menu
- removes need for custom CSS and label property
- ensures consistency across the application

* refactor: remove unneeded css

---------

Co-authored-by: hypercube <0hypercube@gmail.com>, TrueDoctor <dennis@kobert.dev>
2023-07-15 15:07:18 +05:30
Dhruv
9c2520111d Minor Tooling and UI Improvements (#1314)
* [wip]fix: disable fill and gradient tools on bmp images
- aims to fix #1161

* [wip]fix: disable gradient tool for bmp images

* fix: disable gradient tool for bitmap images
- fixes https://github.com/GraphiteEditor/Graphite/issues/1161

* [wip]fix: disable menu bar elements if no open document

* [WIP]feat: render certain menubar elements if document is open

* fix: conditional menu bar rendering fixes
- update menu bar on certain document actions
- fix menu bar order on rendering all elements

* refactor: change conditional menu elements property
- use existing 'disabled' property

* feat: render menu dropdown items conditionally

* fix: revert formatter whitespace changes

* refactor: improve variable naming and message usage
- name menu bar bool flag better
- use SendLayout message and remove unneeded calls
2023-06-24 01:49:00 +05:30
Samyat Gautam
173398ad55 Improve 'add node' menu (#1312)
* improved node adding list with dropdowns and scrolling

* changed arrow icon from default details arrow

* made 'add node' menu appear above mouse when clicking at bottom of nodegraph. Searching automatically opens the dropdowns you need. Set fixed 'add node' menu size

* updated code style to be more clear

* undo mistake changes

---------

Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
2023-06-23 14:01:39 -04:00
Dennis Kobert
40ec52b395 Node macro lambda parameters (#1309)
* Implement parsing of impl Node<I, …> syntax for the macro

* Extend node macro to allow specifying lambda nodes
2023-06-09 16:43:46 +02:00
nat-rix
f76b850b9c Fix Imaginate by porting its JS roundtrip code to graph-based async execution in Rust (#1250)
* Create asynchronous rust imaginate node

* Make a first imaginate request via rust

* Implement parsing of imaginate API result image

* Stop refresh timer from affecting imaginate progress requests

* Add cargo-about clarification for rustls-webpki

* Delete imaginate.ts and all uses of its functions

* Add imaginate img2img feature

* Fix imaginate random seed button

* Fix imaginate ui inferring non-custom resolutions

* Fix the imaginate progress indicator

* Remove ImaginatePreferences from being compiled into node graph

* Regenerate imaginate only when hitting button

* Add ability to terminate imaginate requests

* Add imaginate server check feature

* Do not compile wasm_bindgen bindings in graphite_editor for tests

* Address some review suggestions

- move wasm futures dependency in editor to the future-executor crate
- guard wasm-bindgen in editor behind a `wasm` feature flag
- dont make seed number input a slider
- remove poll_server_check from process_message function beginning
- guard wasm related code behind `cfg(target_arch = "wasm32")` instead
  of `cfg(test)`
- Call the imaginate idle states "Ready" and "Done" instead of "Nothing
  to do"
- Call the imaginate uploading state "Uploading Image" instead of
  "Uploading Input Image"
- Remove the EvalSyncNode

* Fix imaginate host name being restored between graphite instances

also change the progress status texts a bit.

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-06-09 09:03:15 +02:00
Dennis Kobert
45b04f4eb9 Lay groundwork for directly rendering to the canvas without a cpu roundrip (#1291)
* Add Texture handle type

* Add Texture View to shader inputs

* Implement basic rendering pipeline

* Render first texture using render pipeline

* Fix output color space

* Precompute the rendering pipeline

* Move gpu context creation to editor api

* Port gpu-executor nodes to node registry

* Fix canvas nodes and make code compile for non wasm targets

* Pin wasm-bindgen version

* Disable miri temoporarily for better ci times

* Fix formatting

* Remove unsafe block

* Bump wasm-pack version

* Bump wasm-bindgen version

* Add gpu feature guard for push node

* Make Into node async
2023-06-07 17:13:21 +02:00
Dennis Kobert
259dcdc628 Use canvas as target for raster rendering (#1256)
* Implement ApplicationIo

* Simplify output duplication logic

* Fix let node initialization for ExtractImageFrame

* Async macros

* Use manual node registry impl

* Fix canvas insertion into the dom
2023-05-30 20:12:59 +02:00
0HyperCube
0c7b55949d Fix some node connection UI issues (#1248) 2023-05-26 18:02:05 +01: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
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
Keavon Chambers
dcabd6c0b4 Refactor naming to deprecate "node graph frame" terminology (#1187) 2023-04-28 01:30:47 -07: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
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
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