Commit graph

566 commits

Author SHA1 Message Date
adamgerhant
6d74abb4de
Node network subgraph editing (#1750)
* Breadcrumb visualization, nested network consistency, create definitions for Merge internal nodes

* Add index to network inputs, remove imports usage from flatten network

* Replace NodeOutput with NodeInput::Node

* Fully remove imports field, remove unnecessary identity nodes, move Output node to encapsulating network

* Replace previous_outputs with root_node, fix adding artboard/layer to empty network

* Import/Export UI nodes

* Display input/output types dynamically from compiled network

* Add LayerNodeIdentifer::ROOT_PARENT

* Prevent .to_node() on ROOT_PARENT

* Separate NodeGraphMessage and GraphOperationMessage

* General bug fixes with nested networks

* Change layer color, various bug fixes and improvements

* Fix disconnect and set node input for proto nodes and UI export node

* Dashed line to export for previewed node

* Fix deleting proto nodes and nodes that feed into export

* Allow modifications to nodes outside of nested network

* Get network from Node Id parameter

* Change root_node to previous_root_node

* Get TaggedValue from proto node implementation type when disconnecting

* Improve preview functionality and state

* Artboard position and delete children fix

* Name inputs/outputs based on DocumentNodeDefinition or type, fix new artboard/layer insertion

* replace "Link" with "Wire", adjust previewing

* Various bug fixes and improvements

* Modify Sample and Poisson-Disk points, fix incorrect input index and deleting currently viewed node

* Open demo artwork

* Fix opening already upgraded documents and refactor FrontendGraphDataType usages

* Fix deleting within network and other bugs

* Get default node input from compiled network when copying, fix previews, tests, demo artwork

* Code cleanup

* Hide EditorApi and add a comment describing unresolved Import node input types

* Code review

* Replace placeholder ROOT_PARENT NodeId with std::u64::MAX

* Breadcrumb padding

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-06-02 08:01:56 +00:00
Keavon Chambers
d40fb6caad
Add boolean operations (#1759) 2024-05-25 22:02:00 -07:00
Keavon Chambers
6b0822d318 Add Isometric Fountain demo artwork 2024-05-08 19:00:31 -07:00
Keavon Chambers
de84e39c4e Improve backwards compatability robustness of serde-based document format 2024-05-08 17:45:31 -07:00
adamgerhant
bc33eabc3c
Add grid color customization and choice to display as dots (#1743)
* dot grid

* fix warning: unreachable pattern

* grid color select

* add color for all grid types

* Dot grid checkbox and remove prefixed Color functions

* Display dot grid as grid aligned pixels

* Dashed line comment

* Code review and UI design widget placement updates

* Isometric dotted grid

* Early return when cos = 0

* Add spacing, x offset, and color to dot grids

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-05-08 21:36:15 +00:00
Keavon Chambers
07fd2c2782 Add visibility and delete buttons to node sections in the Properties panel 2024-05-07 02:53:30 -07:00
Keavon Chambers
1ce3d59e0f Fix breakage of About Graphite dialog from editor instances refactor 2024-05-07 01:06:14 -07:00
adamgerhant
8d83fa7079
Generalize layers as merge nodes to enable adjustment layers (#1712)
* WIP, backward traversal issues

* Fix some tool issues

* Remove debugging

* Change some indices

* WIP: new artboard node

* WIP: add artboard node

* WIP: Artboard node and create_artboard

* WIP: Artboard node implementation complete

* WIP: Artboards input for output node

* Complete Artboard node

* Generalize LayerNodeIdentifier,  monitor_nodes support for Artboard node, adjust ResizeArtboard/ClearArtboards, move alias validation to Rust

* Fix misaligned artboard click targets

* Generalize/clarify create_layer and insert_between

* non-negative dimensions for resize_artboard

* Show artboards in layer panel

* Generalize create_layer for layer output node

* Generalize delete_layer/delete_artboard to NodeGraphMessage::DeleteNodes. Fixed upstream flow Iter

* remove old primary_input function

* Vertical node visuals, remove is_layer function, rename Layer node to Merge node, toggle display as layer

exposed_value_count type fix

Vertical node visuals, remove is_layer function, rename Layer node to Merge node, toggle display as layer

* Fix demo artwork

* Layer display context menu

* Automatically select artboard, fix warnings

* Improvements to context menu and layer invariant enforcement

* Remove display_as_layer and update load_structure

* Improve load_structure to show more layers, improve FlowIter, improve layer naming, layer rearrangement validation.

* Clean up demo artwork using generalized layers

* Improve design of Layers panel and graph nodes

* MoveSelectedLayersTo rewrite to support generalized layer nodes

* Include artboards in deepest_common_ancestor, fix resize_artboard/delete_artboard, sync artboard tool to layer panel

* MoveSelectedLayersTo adjustments

* Sync non layer node visibility with metadata

* Include non layer nodes when moving/creating layer

* Fix group layers and get_post_node_with_index

* Include non layer nodes in UngroupSelectedLayers

* GroupSelected for all selected nodes, UnGroupSelected position adjustments

* Add grouping for layers in different folders

* Fix hidden layers

* Prevent node from connecting to itself, fix undo automatic node insertion,

* Fix undo CreateEmptyFolder, fix grouping nested layer nodes

* Formatting

* Remove test and check if node is layer from network

* Fix undo group layers

* Check off roadmap

* MoveUpstreamSiblingsToChild adjustments

* Replace tabs with spaces, remove mut from argument

* Final code review pass

---------

Co-authored-by: 0hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-04-30 23:03:42 -07:00
zhiyuan
e769f50877
DropdownInput preview support and ColorButton history improvements (#1598)
* DropdownInput support preview

* fix typo and rm logs

* Add previewable flag

* fix cr typos

* Improve color button history

* rename

* update dropdown preview behaviour

* Color picker preset color

* Another way to handle blend mode preview

* Apply suggestions from code review

* Use on_commit instead of on_update for some dropdowns

* Debugging progress

* add debug

* active not equal to highlight in some cases

* rm logs

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-04-29 17:03:58 -07:00
Keavon Chambers
19eb6ce0ab Remove editor instances concept and clean up JS interop code 2024-04-29 04:17:09 -07:00
Keavon Chambers
597c96a7db Polish and fix small bugs with tilt and zoom navigation 2024-04-28 02:13:18 -07:00
Keavon Chambers
72ba4ddfe4 Add rotation to Repeat node 2024-04-26 15:06:36 -07:00
Shyam Jayakannan
67ba5bcecf
Added fine-grained choices to Snapping options popover (#1730)
* Added Customised Snapping

* Fix snapping choice to Anchors; clean up popover menu code

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-04-18 04:24:15 +00:00
Haikal
bf81a31ff9 Add layer locking feature (#1702)
* Add locking layer feature

* Update locked state data to adjust the refactor

* Make the locked layer cannot be selected using pointer and select all key

* Make locked layer cannot be moved and disable bounding box

* Add locked status selected node on CopyBuffer

* Make locked layer cannot be selected when selected all layers, and disabled GRS and nudging operation on locked layer

* Add refresh document metadata before update button on visible and locked

* Updated from master

* Fix icon logic on panel locked layer

* Make the child locked when the parent is locked, and the child cannot be unlocked if the parent is locked

* Revert "Make the child locked when the parent is locked, and the child cannot be unlocked if the parent is locked"

This reverts commit 7c93259bc2.

* Revert "Fix icon logic on panel locked layer"

This reverts commit 33939f2e84.

* Delete Make Lock button in the node graph top bar

* Add ToggleSelectedLocked to action_with_node_graph_open

* Fix parent and child locking behavior icon on panel

* Fix boolean operator on icon button locking layer

* Make bolean logic more readable in icon button locking layer

* Fix locking layer can be moved or resizing when selected with unlocking layer, disabled pivot widget on locking layer, disable all action on pivot point, alignment, flipping, and boolean operation for locking layer

* Fix axis align drag crash

---------

Co-authored-by: 0hypercube <0hypercube@gmail.com>
2024-04-03 16:08:26 -07:00
Keavon Chambers
938a688fa0 Polish up the Layers panel design 2024-04-01 02:09:01 -07:00
Keavon Chambers
291c580924 Fix number input dragging bug and hide floating point imprecision 2024-03-30 19:06:45 -07:00
Keavon Chambers
27f9e3f00e
Move node visibility flag from NodeNetwork to DocumentNode (#1708)
* protonode -> proto node

* Move node visibility flag from NodeNetwork to DocumentNode

* Add serde default for new field

* Logic improvements
2024-03-27 05:17:08 -07:00
Elbert Ronnie
e9510c5fee
Fix Select tool's scale nudging with multi-layer selection (#1699)
* Fix scale nudging for multiple selection

* Use message discriminant for filtering where possible

* Remove unnecessary parameter from `selected_bounds_document_space`

* Fix the error `target.closest is not a function`

* Minor cleanup

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-25 13:20:30 -07:00
Keavon Chambers
d8255ebb72 Block page render when loading web fonts 2024-03-16 02:52:52 -07:00
Elbert Ronnie
42c822020e
Make auto-panning speed uniform (#1690)
* Make auto-panning speed uniform

* Abstract time-delta calculation to `TimeInfo`

* Update docs and add additional check

* Apply code review changes
2024-03-16 06:36:22 +00:00
Keavon Chambers
5bca931813 Rename handle mirroring to colinear 2024-03-14 07:44:55 -07:00
Keavon Chambers
822b25ceb6 Update npm dependencies across the project 2024-03-09 17:59:23 -08:00
0HyperCube
b31e8f7b6d
Make menu lists searchable (#1499)
* Searchable font list

* Bug fixes and UX polish for edge cases

* More work, still more bugs to fix

* Don't update highlight when not open

* Bug fixes

* Additional bug fixes and code review

* Fix keyboard input being sent to backend

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-09 10:58:13 +00:00
Tanmay Kumar
15ffdf73ca
Fix tool options bar number inputs not being applied before starting a drag with the tool (#1646)
Unfocus elements before control is passed to tool
2024-03-03 14:18:48 -08:00
Keavon Chambers
70dce1c230 Resolve most Clippy lint issues 2024-02-29 00:48:28 -08:00
Elbert Ronnie
8e769e37f6 Add auto-panning when pointer goes beyond viewport edge with Select tool (#1625)
* Add code to shift viewport if mouse is beyond edge

* Allow shifting viewport if mouse is stationary too

* Group all modifier keys into SelectToolPointerKeys

* Cleanup message ordering to remove shifting during resize

* Slow down shifting by half

* Clamp speed; code review cleanup

---------

Co-authored-by: 0hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-02-28 23:52:36 -08:00
Keavon Chambers
4405e01f55 Fix displayed ordering of keyboard shortcuts 2024-02-28 21:51:49 -08:00
Comeza
dc7de4d973
Save work periodically to reduce loss from crashes (#1580)
* Add auto saving

* Fix autosave dispatching message but not saving document

* Clamp set_timeout delay

* Auto save all documents instead of only the active

* Add with_editor to simplify code

* Update consts

* Simplify some more

* Fix typo

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-02-20 03:23:25 +00:00
0HyperCube
0e0e347435
Fix multiple dragged nodes snapping back sometimes (#1619)
Fix dragging a selection of nodes on one axis (in screen pixels) resetting the selection.

Fix dragging on one axis only
2024-02-18 13:56:40 -08:00
0HyperCube
6f6fb3bcd4
Upgrade several Rust dependencies (#1613)
`specta` from Hypercube's fork commit to latest upstream commit
`wasm-bindgen` 0.2.87 -> 0.2.91
`spirv-std` from 0.9 to not-yet-merged commit in https://github.com/EmbarkStudios/rust-gpu/pull/1115
`wgpu` 0.17 -> 0.19
`winit` 0.28.6 -> 0.29
`vello` and `vello_svg` from latest upstream commit to not-yet-merged commit in https://github.com/linebender/vello/pull/427
`resvg` 0.36.0 -> 0.39
`glam` 0.24 -> 0.25
`rustybuzz` 0.8.0 -> 0.10.0
`js-sys` and `web-sys` 0.3.55 -> 0.3.67
`usvg` 0.36.0 -> 0.39
`spirv` 0.2.0 -> 0.3

* Update a couple of dependencies

* More test fixing…

* Use upstream Specta instead of fork

* Update comments in Cargo.toml

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-02-17 15:02:41 -08:00
0HyperCube
80bffd39bf
Node graph box selection when dragging (#1616)
* Node box selection

* Cancel box selection on rmb
2024-02-17 14:24:53 -08:00
Keavon Chambers
fc8b41914b
Fix anti-aliasing in overlays by aligning everything with the pixel grid (#1603) 2024-02-13 20:47:16 -08:00
Keavon Chambers
b18822b1b4 Improve clarity of some complex CSS logic 2024-02-13 16:48:42 -08:00
Keavon Chambers
12e16b9a4e Add Red Dress demo artwork 2024-02-05 14:41:07 -08:00
zhiyuan
9530e55ace
Split widget callbacks into update and commit so only the latter adds a history state (#1584)
* feat: split commit and update layout

* feat: add on_commit callback

* Code review

* fix: refactor

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-02-05 01:32:15 -08:00
Keavon Chambers
8a6854e55b Fix long crash stack traces breaking the GitHub URL 2024-01-28 19:25:27 -08:00
Keavon Chambers
99c199a8f6 Add dev container configuration 2024-01-24 23:04:00 +00:00
Keavon Chambers
5c9d3c5d75 UI refinements for radio buttons and the Snapping/Grid popovers 2024-01-18 05:03:43 -08:00
Keavon Chambers
b4dccb8655 Add a workaround for a Safari rendering bug with floating menus 2024-01-17 00:58:07 -08:00
0HyperCube
002151d9c0
SVG import (#1579)
* SVG import

* Fix error

* Transforms

* Code review nits

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-01-16 17:42:48 -08:00
0HyperCube
c777d4d430
Work around the weird treatment of the primary input (#1575)
* Work around the weird treatment of the primary input

* take2
2024-01-14 00:35:45 +00:00
0HyperCube
456ca170a4
Layer and grid snapping systems (#1521)
* Grid overlays

* Rectangle tool basic snapping

* Fix bezier demos

* Fix bézier crate tests

* Constrained snapping for circle & shape tool

* Line tool snapping

* Pen tool snapping

* Path tool snapping

* Snapping whilst dragging layers (not constrained)

* Constrained drag

* Resize snapping

* Normal and tangent

* Cleanup

* Grid snapping

* Grid snapping

* Fix imports

* Fix bug in artboard tool

* Fix hang on 0 size grid spacing

* Fix NaN when scaling

* Polishing

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-01-13 14:32:10 +00:00
Keavon Chambers
78a1bb17cd Move selected node list from DocumentMetadata to the document (#1565) 2024-01-13 04:52:47 -08:00
Keavon Chambers
aab0fcf84c
Update graph UI and improve simplicity and robustness of sending graph and layer panel updates (#1564)
* WIP

* Fix loading the structure of layers

* Fix broken indents

* Remove debugging stuff

* Fix displaying errors and node graph UI fixes/improvements

* Fix compilation failure

---------

Co-authored-by: 0hypercube <0hypercube@gmail.com>
2024-01-13 04:15:36 -08:00
Keavon Chambers
1727694dfc Fix a couple frontend rendering flaws 2024-01-07 07:36:36 -08:00
Keavon Chambers
7998947202 Remove GRAPHITE_DOCUMENT_VERSION 2024-01-06 17:25:05 -08:00
Keavon Chambers
c7fd9cfc21 New demo artwork: Procedural String Lights 2024-01-05 15:16:48 -08:00
Keavon Chambers
d268afb7fb Fix Bezier-rs interactive demos and migrate its Webpack bundler to Vite 2024-01-04 23:13:40 -08:00
0HyperCube
947a131a4b
Add graph type error diagnostics to the UI (#1535)
* Fontend input types

* Fix index of errors / types

* Bug fixes, styling improvements, and code review

* Improvements to the error box

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-12-29 08:38:45 +00:00
Keavon Chambers
96b5d7b520
Many subtle improvements to the UI design system (#1537) 2023-12-28 04:35:20 -08:00