Commit graph

566 commits

Author SHA1 Message Date
0HyperCube
5827e989dc Migrate the Select tool to the document graph (#1433)
* function for accessing document metadata

* Better select tool

* Fix render

* Fix transforms

* Fix loading saved documents

* Populate graph UI when loading autosave

* Multiple transform nodes

* Fix deep select

* Graph tooltips

* Fix flip axis icon

* Show disabled widgets

* Stop select tool from selecting artboards

* Disable (not hide) the pivot widget; remove Deep/Shallow select for now

* Code review changes

* Fix pivot position with select tool

* Fix incorrectly selected layers when shift clicking

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-10-17 11:09:32 -07:00
Dennis Kobert
833f41bccb Insert pasted images as layers in document graph (#1418)
Changes:

Graph is evaluated on every viewport change
move all navigation logic into the viewport
reduce the number of js roundtrips
add canvas rendering
enable image pasting
various cleanups
Fix cache nodes being reset every evaluation
2023-10-17 11:02:07 -07:00
hypercube
40aab0332a Fix eyedropper tool 2023-10-17 11:02:06 -07:00
0hypercube
4cd72edb64 Initial work migrating vector layers to document graph
* Fix pen tool (except overlays)
* Thumbnail of only the layer and not the composite
* Fix occasional transform breakages
* Constrain size of thumbnail
* Insert new layers at the top
* Broken layer tree
* Fix crash when drawing
* Reduce calls to send graph
* Reduce calls to updating properties
* Store cached transforms upon the document
* Fix missing node UI updates
* Fix fill tool and clean up imports and indentation
* Error on overide existing layer
* Fix pen tool (partially)
* Fix some lints
2023-10-17 11:02:06 -07:00
mobile-bungalow
9667e5173b
Allow toggling smooth/sharp angle from the path tool options bar (#1415)
* menu in option

* smoothing controls work

* fixed type error

* fix flipping behavior

* silence warning

* consolidate selection state

* update positions options

* blinking logic fixed, smoothing logic implemented

* fixed arbitrary looping when flipping from sharp to smooth

* remove warning

* Tidying up

* refactor manipulator smoothing code, remove bitflags, rename

* Make the point smooth/sharp support mixed better

* Code review tweaks

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-09-11 17:36:08 -07:00
Keavon Chambers
88bdf9580f Make RadioInput accept optional selected_index 2023-09-11 15:40:05 -07:00
Keavon Chambers
ee1a228bfd Fix regression blocking inputs in the graph 2023-09-02 00:19:03 -07:00
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
0HyperCube
b881385e3b
Update wasm-bindgen, syn and wgpu (#1398) 2023-08-23 14:53:56 +00: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
Dennis Kobert
d74e4b2ab3
Disable parcel cache for the dev server 2023-08-19 01:10:19 +02: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
cfe38c6413 Fix prod deployment cache issue and analytics templating 2023-08-12 13:44: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
Dennis Kobert
40f9a7d051
Fix index.html to include the favicon (#1347)
Fix index.html to include the favicon
2023-07-31 10:29:02 -07:00
Keavon Chambers
9d425db5a4 Rename "Layer Tree" panel to "Layers" 2023-07-28 17:00:06 -07:00
Dennis Kobert
1d08959bf8 Bump wasm-pack version (#1333) 2023-07-28 02:53:45 +02: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
Orson Peters
0c93a62d55 Add blit caching and blend modes to Brush tool (#1268)
Added blit caching.

Added bulk memory target feature.

Added brush texture caching.

Removed dead format call.

Fix brush_texture_cache crashing on serialization.
2023-06-07 12:24:21 +02:00
Dennis Kobert
26473a8002 Restructure node graph execution to be safer (#1277)
* Reorganize file structure

* Remove all unsafe code

* Add testcase for debugging ub

* Convert into proper test with fail condition

* General cleanup

* Fix tests

* Add feature guard for deallocation

* Use raw pointer for storing values to avoid violating aliasing rules

* Add comment explaining the disabling of simd128

* Fix brush node

* Fix formatting
2023-06-03 01:18:44 +02:00
Dennis Kobert
4e1bfddcd8 Remove unsafe code and clean up the code base in general (#1263)
* Remove unsafe code

* Make node graph test syncronous

* Add miri step to ci

* Remove unsafe from node graph evaluation

* Replace operation pseudo_hash with hash based on discriminant

* Fix test

* Move memo module to core and make it safe

* Fix formatting

* Remove unused stuff from gstd

* Use safe casting for creating key variants

* Fix memo node types

* Fix ref node

* "fix" ub

* Use correct input types for ExtractImageFrame

* Fix types for async nodes

* Fix missing implementation

* Manually override output type for async nodes

* Fix types for EditorApi

* Fix output type for WasmSurfaceHandle

* Remove unused miri.yml

* Fix incorrect type for cache node
2023-06-02 11:05:32 +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
Dennis Kobert
0586d52f3a Implement experimental WebGPU support (#1238)
* Web gpu execution MVP

Ready infrastructure for wgpu experimentation

Start implementing simple gpu test case

Fix Extract Node not working with nested networks

Convert inputs for extracted node to network inputs

Fix missing cors headers

Feature gate gcore to make it once again no-std compatible

Add skeleton structure gpu shader

Work on gpu node graph output saving

Fix Get and Set nodes

Fix storage nodes

Fix shader construction errors -> spirv errors

Add unsafe version

Add once cell node

Web gpu execution MVP
2023-05-27 19:27:46 +02:00
Dennis Kobert
4bd9fbd073 Make the dynamic node graph execution asynchronous (#1218)
* 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

* Fix nodes

* Simplify lifetims for node macro + make node macro more modular

* Reenable more nodes

* Fix pasting images

* Remove http test from brush node

* Fix output type for cache node

* Fix types for let scope

* Fix formatting
2023-05-27 11:48:57 +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