Commit graph

2382 commits

Author SHA1 Message Date
Keavon Chambers
1fca813797
Add initial Graphene docs to the contributor guide (#1686)
* Graphene documentation

* Polishing edits
2024-05-06 18:21:15 -07:00
adamgerhant
4c3856833b
Code cleanup and refactor for generalized layers (#1738)
* Move functions to messages to fix undo bugs for UnGroup and Group

* Copy+Paste for generalized layer nodes

* Fix MoveSelectedLayersTo and GroupSelectedLayers by extracting functions into messages

* Fix tests, replace FrontendMessage:TriggerPaste with PortfolioMessage::PasteIntoFolder

* Formatting

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-05-04 22:11:48 -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
Elbert Ronnie
beb88d280c
Bezier-rs: Add calculations for area and centroid of subpaths (#1729)
* add code to calculate area and centroid of subpath

* change library to poly_it

* add a demo of area and centroid

* modify algorithm to consider negetive area as positive

* add code for manipulating polynomials in bezier-rs

* remove `poly_it` dependency and use custom Polynomial

* formatting floats to skip last zero

* add debug mechanism

* collect both intersection points instead of one

* fix test and cargo fmt

* apply minimum separation filtering in self_intersection and use better endpoint filtering algorithm

* remove debug mechanism and cargo fmt

* consider the subpath as closed for intersection calculation

* add documentation for polynomial.rs

* impl display for Polynomial

* make area always positive

* add missing docs

* fix test and cargo fmt

* Naming/formatting code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-04-29 19:19:12 -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
Tiger3018
282969df3d
Fix shallow/deep selection (#1725)
* fix: remove folder #1595 when clicked, except for shallow select.

This should also fix other tools, like Fill tool which hook Lmb hints.

* TODO: shallow select is not working when interval clicks.
* TODO: shallow hover is showed same as deep hover.

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-04-29 16:04:27 -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
6a1a145d19 Update roadmap with new features and icons 2024-04-27 01:36:46 -07:00
Keavon Chambers
72ba4ddfe4 Add rotation to Repeat node 2024-04-26 15:06:36 -07:00
Sahil gill
5f4960db9b
Fix crash when Pen tool's in-progress point snaps along an angle with its previous anchor (#1701)
changes
2024-04-19 16:35:58 +01:00
Haikal
1ccd8ae4ec
Insert duplicated layers directly above their selected source layers (#1726)
Make insert index of duplicated layer on top of layer that's being duplicated
2024-04-17 22:01:21 -07:00
Shyam Jayakannan
e55578a016
Fix interactive outlining of layers within the Select tool's box selection (#1727)
* changes made to correct outlining behavior

* Comment fixups

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-04-18 04:48:29 +00: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
Karthik Prakash
3019cc7253
Add alpha to Extract Channel node and remove Extract Alpha node (#1731)
* add `TaggedValue::RedGreenBlueAlpha`

* add alpha to `ExtractChannelNode`

* remove `ExtractAlphaNode` from `Split Channels`

* remove `ExtractAlphaNode`
2024-04-17 15:44:14 -07:00
Karthik Prakash
438c45eb80
Add corner rounding to the Rectangle node (#1648)
* add skeleton implementation

* add corner rounding

* fix crash when `border_radius` is zero

* rename `Border Radius` to `Corner Radius`

* add clamped property

* add `TaggedValue::F64Array4`

* add frontend support for individual corner rounding

* added individual corner rounding

* fix rebase

* change default values when switching rounding type

* fix crash caused by negative scale

* remove `Any` trait

* add `Message::Batched`

* fix stale property bug

* add smarter clamping for individual rounding

* Rearrange widgets in properties panel

* update individual clamping algorithm

* add better variable names

* make variable names clearer

* Final code cleanup

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-04-06 05:09:55 +00:00
abundance-io
d09e7eaf86
Update contributor guide installation instructions for Fedora-based Linux OSs (#1718)
* added fedora based distribution instructions changed outdated npm optional install command

* removed vite temporary timestamp file

* Apply suggestions from code review

Nits

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-04-03 23:34:57 +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
0f43a254af Update cargo dependencies to fix security advisories 2024-04-03 16:08:13 -07:00
Keavon Chambers
938a688fa0 Polish up the Layers panel design 2024-04-01 02:09:01 -07:00
Haikal
5bab38e173
Exclude hidden layers from Ctrl+A selection; prevent G/R/S/nudging hidden layers (#1697)
* Exclude hidden layer to be selected on Select All Layer

* Add hide layer action to history

* Fix error call the function

* Add hide layer action to history state

* Make hidden layer cannot be transform like G/R/S and nudges

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-31 07:48:17 +00:00
Muhammad Aqdas
e22db31738
Fix "contrain" typo (#1717)
Fix typo 'contrain' to true 'constrain

Fix typo 'contrain' to true 'constrain'
2024-03-31 06:15:57 +00:00
Keavon Chambers
291c580924 Fix number input dragging bug and hide floating point imprecision 2024-03-30 19:06:45 -07:00
Keavon Chambers
46a9fc031a Website home page and roadmap clarifications 2024-03-27 05:25:39 -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
Haikal
d3e3e19822
Fix hidden state missing from copy/paste, causing hidden layers to reappear when pasted or grouped (#1698)
Add data state visiblity of node when copy-paste
2024-03-25 13:27:30 -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
0a9bd41be1
Code cleanup and refactoring to enhance consistency (#1695)
- Move message handler payload data into structs
- Organize the file structure used by `editor/src/messages/portfolio/document` `/node_graph` and `/graph_operation`
- Make derive attributes use `serde::Serialize, serde::Deserialize` consistently instead of `use serde::{Deserialize, Serialize};` imports
- Various other code cleanup and refactoring
2024-03-20 21:28:51 -07:00
Nicolás Mayora
ed3f7acdd7
Fix the Path tool's point dragging getting offset when viewport is panned (#1693)
fix: moving a point with the path tool after panning

Co-authored-by: Nico Mayora <mayoranicolas0104@gmail.com>
2024-03-17 23:30:53 -07:00
Mohamed Osama
058aa7121c
Fix ungrouping bugs to preserve layer ordering and prevent incorrect layer deletion (#1672)
* Ungroup layer external consistency and fix bug

* no message

* no message

* no message

* no message

* fix-bug

* Code review: make code more idiomatic

* Fix layres reversed when ungroup with index != -1

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-16 11:44:30 -07:00
Keavon Chambers
d8255ebb72 Block page render when loading web fonts 2024-03-16 02:52:52 -07:00
Karthik Prakash
8bc389a3b4
Fix artboard deletion (#1651)
* Fix `Document > Clear Artboards`

* Fix `Artboard Tool > Delete`

* fix graph disconnection when deleting artboard

* fix empty artboard deletion

* Code readability improvements

* fix `Clear Artboards`

* add comments

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-16 01:56:39 -07:00
Keavon Chambers
1a2a0e8757 Minor code cleanup and spelling fix 2024-03-16 00:30:29 -07:00
Mohamed Osama
6630e2b964
Place new folders in the correct stack order relative to other selected layers (#1678)
* New folder placed directly above the topmost selected layer in the hierarchy (at the level of the least nested layer)

* fix bug

* Replace `.collect().contains()` with `.any()` and `if` statement with `.then_some()`

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-16 07:26:46 +00: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
shipp02
56f8ecacc9
Refresh graph view overlay if it's open when switching documents (#1691)
* Update Graph View Overlay if it is open when switching documents

* Resolve comments
2024-03-15 19:52:20 -07:00
Keavon Chambers
5bca931813 Rename handle mirroring to colinear 2024-03-14 07:44:55 -07:00
Elbert Ronnie
ea4f3d8bba
Add auto-panning to all remaining tools (#1682)
* Add auto-panning to Gradient tool

* Add auto-panning to Path tool

* Add auto-panning to Pen tool

* Add auto-panning to Spline tool

* Add auto-panning to Line tool

* Add auto-panning to Rectangle tool

* Add auto-panning to Ellipse tool

* Add auto-panning to Polygon tool

* Hide `PointerOutsideViewport` in debug messages

* cargo fmt

* Code review cleanup

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-14 06:05:33 +00:00
milan-sedivy
9ac10cdcf8
Comprehensively polish up the input hints across all tools and states (#1670)
* Add missing keyhints to most tools

* Standardize hints further

* Improve GRS numerical display values

* Additional hints improvements

* Improve Path tool hints; add Ctrl+Shift+A point deselection

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-12 20:20:25 -07:00
Roshan P
2263b0ab89
New node: Solidify Stroke (#1650)
* added struct and registered fill from stroke node. not functional yet.

* properly registered new node

* finished fill-from-stroke feature. works on both closed and open shapes. supports line caps and line joins.

* fixed import issues and miter limit handling

* fix outline function. use both subpaths for solid shapes now

* code quality improvements

* use radius instead of diameter, functionality not yet working for shapes as transform is not properly applied before calculating new shapes.

* Updated to follow new VectorData structure. Fully functional.

* fix repeat node

* remove comment

* add a test, remove unused code.
2024-03-11 17:19:29 -07:00
milan-sedivy
c3a886116a
Block the undo shortcut while dragging with a tool (#1675)
Add NOOP message and bind it to CTRL + Z + LMB
2024-03-11 16:03:08 -07:00
milan-sedivy
01da53eba0
Make the Fill tool's fill click operation cancellable (#1666)
* Make FillTool a draggable tool with abortable fills

* Unify keyhints across tools

* Apply suggestions from code review

* Formatting

* Fix FillTool when draged outside of shape's layer and add toolswitch abort

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-11 14:18:49 -07:00
milan-sedivy
343523ab34
Improve the Select tool's input hints (#1667)
* Refactor hints in SelectTool

* Unify Keyhints and fix DrawingBox state so that it holds nested behaviour info

* Code review cleanup; rename hints

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-11 02:11:17 -07:00
milan-sedivy
dcce519426
Fix switch to/from Artboard tool firing an undo (#1668)
* Fix tool switch causing abort of ArtboardTool transaction when it shouldn't

* Add cancellation keyhints

* Unify the cancel keyhints with other tools

* Consolidate hints

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-11 00:46:38 -07:00
Keavon Chambers
fd54cda445 Rename NodeNetwork inputs/outputs to imports/exports 2024-03-11 00:13:01 -07:00
Keavon Chambers
137853eb40 Simplify Rust deps that depended on a specific commit hash 2024-03-11 00:00:05 -07:00
milan-sedivy
d714166c69
Don't save undo/redo history when aborting transactions (#1660)
* Create a forgetable undo/redo function used by AbortTransaction

* Rework and fix new undo/redo functions

* Add space before comments

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-10 18:39:33 -07:00
Keavon Chambers
822b25ceb6 Update npm dependencies across the project 2024-03-09 17:59:23 -08:00
milan-sedivy
aa9a3e648a
Fix cancellation of drag actions in all tools where it's missing (#1664)
* Change message sent from DocumentMessage::Undo to DocumentMessage::AbortTransaction while aborting select tool

* Fix NavigationTool not aborting

* Fix NavigationTool tilt

* Make gradient tool abortable

* Make PathTool drag actions abortable

* Make FreeHand Tool abortable

* Make BrushTool abortable

* Fix filename typo

* Make artboards also abortable

* Rearrange key bindings for consistency

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-09 16:19:56 -08:00
0HyperCube
218e9675fd
Attribute-based vector format refactor (#1624)
* Initial vector format structure

* Click targets

* Code review pass

* Remove subpaths from vector data

* Morph node & vector node tests

* Insignificant change

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-09 10:27:30 -08:00