Commit graph

454 commits

Author SHA1 Message Date
Keavon Chambers
510e8a6fea WIP experimental transparent viewport hole 2024-04-04 23:08:04 -06: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
Keavon Chambers
34f952bad1
Convert u64 IDs to newtypes (#1532) 2023-12-22 03:24:13 -08:00
Keavon Chambers
7bfe0ce55b
Retire layer paths used throughout the code (#1531)
* Part 1

* Part 2

* Part 3

* Part 4

* Part 5

* Part 6

* Part 7

* Part 8
2023-12-21 19:32:46 -08:00
Keavon Chambers
92203f3576
Remove the whole document-legacy crate (#1524)
Remove the whole document-legacy crate

Closes #1520
2023-12-20 05:45:54 -08:00
Keavon Chambers
dcd38f2e4c Remove all references to legacy layers (#1523)
* Remove visible field from LegacyLayer

* Remove LegacyLayer wrapper around LegacyLayerType

* Remove FolderLegacyLayer and LayerLegacyLayer wrappers around their data

* Remove legacy layers
2023-12-19 20:50:45 -08:00
Keavon Chambers
9a7d7de8fa Remove most of document-legacy (#1519)
* Remove boolean ops and unused doc-legacy Operations

* Remove Shape legacy layers

* Remove legacy layer Properties panel code

* Remove additional unused doc-legacy Operations

* Removed unused rendering-related legacy-layer code

* Upgrade dep so CI builds

* Remove various additional unused functions and messages

* Remove the LayerData trait

* Remove RenderData struct and usages

* Banish the Operations system

* Further removals
2023-12-19 04:36:19 -08:00
0HyperCube
c42d030f18 New overlay system (#1516)
* Port gradient tool overlays

* Fix tests

* Text tool

* Artboard tool and some of select tool

* Port select tool drawing box

* Pen and path tool

* Remove overlays document

* Show the overlay refactor as done on the website roadmap

* Select tool bounds in layer space (first layer)

* Code review and fixes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-12-18 11:17:43 +00:00
Keavon Chambers
9f0ea35d9b New node: Noise Pattern (#1518)
Add the Noise Pattern node

Closes #1517
2023-12-17 02:06:25 -08:00
Keavon Chambers
83af879a7c
Fix the Imaginate node from crashing (#1512)
* Allow generic node input for type inference

* Make imaginate resolution picking depend on the image resolution instead of the transform

* Remove dead code

* Fix console spam after crash

* Fix crash when disconnecting Imaginate node input

* Update Imaginate tool tooltip

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2023-12-12 22:39:33 -08:00
0HyperCube
29222700f4
Fix the blend mode and opacity widgets of the Layers panel (#1506)
* Fix blend mode and opacity

* Cleanup and bug fixes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-12-12 09:27:23 +00:00
0HyperCube
af4c793f43
Serve the demo artwork in each build (#1494)
* Serve local demo artwork

* Disable restricted import lint

* Revert

* Switch approach to vite-multiple-assets plugin

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-12-11 01:06:00 -08:00
0HyperCube
99823e952a
Fix layers insert mark disappearing (#1493)
* Fix layers insert mark disappearing

* Move insertion line up 1px

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-12-09 13:34:15 +00:00
Keavon Chambers
5a6815dd91 Rename Raster to Bitmap 2023-12-08 16:18:56 -08:00