Commit graph

2358 commits

Author SHA1 Message Date
Priyanshu
65171a5b8e
Fix Path tool box selection not selecting enclosed segments, only intersected (#3141)
fix path tool box selection not selecting the enclosed segment

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-09-07 22:08:56 +00:00
Adam Gerhant
7686edd47b
Add a cancel transaction message to the history system (#3121)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
Add cancel transaction

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-09-07 14:00:42 -07:00
Adesh Gupta
57111cff92
Fix undo history getting stuck when the Select tool clicks the background to deselect (#3143)
Remove unnecessary start transaction messages

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-09-07 19:55:12 +00:00
Keavon Chambers
a2c0693038
Fix most known issues with migrations failing to open documents from the past year (#3148) 2025-09-07 11:10:03 -07:00
Keavon Chambers
89c9cf1352 Fix infinite recursion introduced in #2795 that occurs in old document migrations
Some checks failed
Editor: Dev & CI / build (push) Has been cancelled
Editor: Dev & CI / cargo-deny (push) Has been cancelled
2025-09-05 14:04:10 -07:00
Firestar99
ad99c14b29
Shaders: Provide WgpuExecutor via Scope (#3144)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
shaders: automatically connect wgpu-executor
2025-09-05 18:51:17 +00:00
Firestar99
f12b4da549
Shaders: add BufferStruct to support bool and enums (#3109)
* node-macro: modernize `node` macro

* node-macro: add `CrateIdent` struct containing resolved crate paths

* shaders: add trait `BufferStruct` and derive macro

* shaders: `gamma_correction` and `channel_mixer` gpu nodes

* shaders: `selective_color` gpu node

* shaders: `brightness_contrast_classic` gpu node

* shaders: append GPU to display name

* node-macro: fixup doc links

* shaders: consistently append " GPU" to all shader node names
2025-09-05 16:32:41 +00:00
Dennis Kobert
acd7ba38cc
Graphene: Fine-grained context caching (#2500)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* RFC: Fine Grained Context Caching

* Fix typos

* Fix label

* Add description of inject traits

* Explicitly support context modification

* Start implementation of context invalidation

* Add inject trait variants
* Route Extract / Inject traits to the proto nodes

* Implement context dependency analysis

* Implement context modification node insertion

* Fix erronous force graph run message

* Fix Extract* Inject* annotations in the nodes

* Require Hash implementation for VarArgs

* Fix nullification node insertion

* Cross of done items unresolved questions section

* Update Cargo.lock

* Fix context features propagation

* Update demo artwork

* Remove BondlessFootprint and FreezeRealTime nodes

* Fix migration

* Add migrations for adding context features to old networks

* Always update real time regardless of animation state

* Cargo fmt

* Fix tests

* Readd sed command to hopefully fix profile result parsing

* Add debug output to profiling pr

* Use new totals instead of summaries for for iai results

* Even more debugging

* Use correct debug metrics (hopefully)

* Add more MemoNode implementations

* Add context features annotation to shader node macro

* Cleanup

* Time -> RealTime

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-09-05 11:44:26 +00:00
Timon
c081d0a9de
Allow the release info build script to work without requiring Git to be installed (#3105)
* Prevent panic if env GRAPHITE_GIT_COMMIT_HASH is less than 8 chars long

* Improve release info build script

* Nits

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-09-05 09:09:29 +00:00
Firestar99
5d441c2e18
Shaders: runtime and shader node codegen (#2985)
* shader-rt: initial

* shader-rt: fix recursion when generating shader node

* shader-rt: replace gpu node's args and ret types with `Raster<GPU>`

* shader-rt: properly cfg out the gpu node

* shader-rt: fix `impl Context` in the wrong places

* shader-rt: disable gpu blend node, needs two images

* shader-rt: connect shader runtime

* shader-rt: pass WgpuExecutor by reference

* shader-rt: correct bindings with derpy arg buffer

* shader-rt: manual pipeline layout, fixing errors when bindings got DCE'd

* shader-rt: correct RT format, working invert gpu node

* shader-rt: cleanup codegen with common sym struct

* shader-rt: correct arg buffer handling

* shader-nodes feature: put shader nodes behind feature gate

* shader-nodes feature: rename any `gpu_node` to `shader-node`

* shaders-rt: fix wgpu label name

* shaders-rt: explain fullscreen_vertex coordinates with a drawing
2025-09-05 08:33:53 +02:00
Dennis Kobert
7dc86b36ca
Fix profiling CI action by avoiding command line length limits (#3136)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
Fix profiling ci by avoiding comand line length limits
2025-09-04 12:22:17 +02:00
Firestar99
a10103311e
Shaders: rust-gpu integration to compile shader nodes to WGSL (#3097)
Some checks failed
Editor: Dev & CI / build (push) Has been cancelled
Editor: Dev & CI / cargo-deny (push) Has been cancelled
* shaders: shader compilation setup

* nix: use rustc_codegen_spirv.so from nix

* shaders: codegen for per_pixel_adjust shader nodes

* shaders: disable nodes needing bool

* shaders: `#[repr(u32)]` some enums

* shaders: add lint ignores from rust-gpu

* shaders: fix node-macro tests

* gcore-shaders: toml cleanup

* shader-nodes feature: put rust-gpu to wgsl compile behind feature gate

* shaders: fix use TokenStream2

* shaders: allow providing shader externally

* Update iai runner in workflow

---------

Co-authored-by: Timon Schelling <me@timon.zip>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2025-09-02 14:10:32 +00:00
Timon
083dfa5f49
Clean up autosave persistence (#3115)
* Set auto save state to false on document rename

* Update open document list on transaction commit and aboard

* Use current network to compute hash

Was using the last element in undo
Before artworks where not auto saved when the had no undo history

* Refactor persistence
2025-09-02 13:27:38 +00:00
Keavon Chambers
b5ebe78f5e
Update all frontend npm dependencies except Svelte and Vite (#3120)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* Upgrade node dependencies except Svelte 5 and its peer deps

* Fix lint errors

* Fix previous Rust deps upgrade breakage

* Fix demo artwork

* Allow profiling CI workflow to fail
2025-09-01 17:22:30 -07:00
Firestar99
be3de511f2
Desktop: Pin CEF version (#3113)
Some checks failed
Editor: Dev & CI / build (push) Has been cancelled
Editor: Dev & CI / cargo-deny (push) Has been cancelled
Fixed CEF cargo dependency so `cargo update` does not update it
2025-08-31 10:22:34 +00:00
Keavon Chambers
29684dde45
Update Rust dependencies (#3112)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* Update Rust dependencies

* Bump versions

* Try older ctor
2025-08-30 20:06:56 -07:00
Timon
101ae6d000
Add nix configuration for the rust-gpu toolchain (#3027)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* nix: Try providing cargo-rust-gpu to nix devs, naga branch

* nix: Try providing cargo-rust-gpu to nix devs 2

* nix: Add exec with rust-gpu env script to flake

* nix: override Path for rust gpu

* nix: rust-gpu with `use-compiled-tools` to fix differences

* nix: remove spirv-tools

---------

Co-authored-by: firestar99 <firestar99@sydow.cloud>
2025-08-30 16:42:07 +00:00
Meet Zalavadiya
0a153150f5
Add quick measurement support to the Artboard tool for distances between artboard edges (#3102)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* logic added for artboard

* fixed measurement logic

* fix linting issues

* removed unused code

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-08-29 21:27:29 +00:00
Adam Gerhant
f1a1275601
Add support for adding/removing a graph's primary imports/exports separately from the secondary (#3089)
* Primary Import/Export

* Primary Import/Export

* Complete import exports

* Final changes

* Improve line width

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-08-29 20:57:15 +00:00
Firestar99
ce1cd1706b
Disable proc-macros crate from being tested due to cargo bug (#3103)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* cargo: remove unused `editor/ron` feature

* cargo: add wgpu-executor as a member, sort list

* cargo: test every crate by default

* cargo: disable testing of `graphite-proc-macros`
2025-08-29 12:25:35 +02:00
mTvare
c14e67ec28
Fix outside stroke alignment not using masks when transparent (#3060)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* Fix outside stroke alignment not using masks when transparent

* Fix for vello

* fix fixes

* cargo fmt

* scale stroke by align type

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-08-28 13:28:51 -07:00
Timon
1d4d1026d4
Desktop: Make embedded resources optional (#3094)
* Make embedding resources optional

* Move remaining cef rc to internal module

* Move embedded resources to separate crate

* Review fixup

* Fix

* Fix read

* Add read error
2025-08-28 17:18:18 +00:00
Firestar99
95ef8a5343
Change Table<Color> node inputs to Color where only one value is used so GPU nodes work (#3096)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* graster-nodes: change `Table<Color>` params to `Color` where only one value is used

* Re-add support for Color and Option<Color>

* Add warning when a default value isn't parsed

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
2025-08-28 15:16:56 +02:00
Priyanshu
9987112cc9
New node: 'Separate Subpaths' to break subpaths into individual vector table rows (#3069)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* impl separate paths node

* rename

* refactor

* Rename nodes 'Split Segments' -> 'Cut Segments' and 'Split Path' -> 'Cut Path'

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-08-28 06:07:09 +00:00
Timon
ad59e1c622
Desktop: Add window control buttons for Linux (#3081)
* Add window buttons for linux

* Code and design review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-08-28 03:53:43 +00:00
Firestar99
82784b46a0
Add node input type support for f32 to enable usage on GPU (#3095)
* update Cargo.lock

* f32: switch to f32 params

* f32: more f32 params, remove f32 casts

* f32: property support for f32

* f32: fix test `stable_node_id_generation`

* Fix f32 properties

* Fix f32 frontend data types

* Rename TaggedValue::Vec2 to ::FVec2 and ::Affine2 to ::FAffine2

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-08-27 20:08:45 -07:00
Firestar99
a199a5fd64
Make CI reject an out-of-date Cargo.lock manifest (#3101)
* ci: detect out of date Cargo.lock

* update Cargo.lock

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-08-27 17:51:33 -07:00
Adesh Gupta
34b52bcc54
Clean up Path tool related code and fix bugs in several cases (#3070)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* Fix regressions related to path tool

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-08-27 23:42:04 +00:00
Priyanshu
57853f755b
Fix box selection regression where only intersected, not contained, objects get selected (#3093)
* fix insideness checking

* fix selection insideness checking

* Revert changes to comments

* Revert unneed rename

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-08-27 21:22:13 +00:00
Firestar99
a744499f4f
Shaders: more graster-nodes no-std fixups (#3090)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* gcore-shaders: fix missing `num-traits/libm` features

* graster-nodes: fix missing cfg on use statements

* shaders: use unchecked Color constructors

* graster-nodes: remove async from shader nodes not needing it

* gcore-shaders: remove explicit fn pointer

* graster-nodes: make kurbo std-only

* graster-nodes: replace glam reexport with normal dep

* gcore: impl Display for ProtoNodeIdentifier

* unify glam workspace dep
2025-08-26 18:25:05 +00:00
Timon
c5991c6f61
Desktop: show platform specific window buttons (#3078)
Some checks failed
Editor: Dev & CI / build (push) Has been cancelled
Editor: Dev & CI / cargo-deny (push) Has been cancelled
Implement app window button functionality and set platform
2025-08-25 14:15:31 +00:00
Timon
508606cdba
Desktop: add missing txt file mime type mapping (#3091)
add missing txt file extension to mime type mapping

missing mapping caused license dialog that loads txt file to fail and report no network connection
2025-08-25 15:51:59 +02:00
Dennis Kobert
d9cbf975ff
Deprecate automatic composition (#3088)
Some checks failed
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
Website / build (push) Has been cancelled
* Make manual_compositon non optional and rename to call_argument

* Fix clippy warnings

* Remove automatic composition compiler infrastructure

* Implement document migration

* Fix tests

* Fix compilation on web

* Fix doble number test

* Remove extra parens

* Cleanup

* Update demo artwork

* Remove last compose node mention

* Remove last mention of manual composition
2025-08-24 08:34:59 +00:00
Dennis Kobert
bb364c92ad
Fix automatic Into node insertion (#3087)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
Fix automatic into node insertion
2025-08-23 18:21:54 +02:00
Dennis Kobert
354bf93364
Store document node inputs in Arc to reduce memory consumption (#3086)
Store values in memo hash contanier in arc
2025-08-23 17:24:41 +02:00
Dennis Kobert
469f0a6c30
Remove lambda node inputs since they are no longer used (#3084)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* Remove lambda node inputs as they are now unused

* Fix warnings

* Fix tests

* Fix clippy warning
2025-08-23 12:16:49 +02:00
Dennis Kobert
7377871106
Fix clippy warnings (#3085)
* Run clippy fix

* Clippy v2

* Make const item static

* Cargo fmt
2025-08-23 11:45:47 +02:00
Timon
c6ec3a27ca
Desktop: Buffer web messages until connection is initialized (#3082)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
Buffer web messages until connection is initialized
2025-08-22 15:15:17 +00:00
Dennis Kobert
a4ec50d8ba
Improve robustness and performance of the boolean operation algorithm (#2191)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* Improve perf of path bool lib

* Use swap remove

* Use outer/inner bounding box for inclusion testing

* Reuse allocations for hit testing

* Use direct root finding for inclusion testing

* Reuse bounding box

* Use faster hash and specify capacities

* Use hashmap based approach for find vertices

* Unroll find_vertecies loop and use 32 bit positions

* Tune initial vec capacities

* Remove unused bounding boxes

* Use smallvec for storing outgoing edges

* Improve allocations for compute_minor

* Use approximate bounding box for edge finding

* Transition aabb to use glam vecs

* Make find vertecies use 64 bit again this is slower but less likely to cause issues

* Improve intersection candidate finding

* Remove loop check in bit vec iter

* Special case cubic line intersections

* Optimize grid rounding and add debug output

* Remove file write

* Remove faulty line intersection

* Fix grid rounding

* Improve robustness and cleanaup code

* Make elided lifetime explicit

* Fix tests

* Fix a boolean ops crash

* Add comment

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-08-21 23:15:36 +00:00
Dennis Kobert
e4dd3ce806
Desktop: Use multithreaded CEF event loop on Windows and Linux (#3076)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* Prototype multi threaded event loop

* Fix input event dispatch

* Remove dead code

* Reenable do_message_loop_work for macos targets

* Cleanup

* Review cleanup

* Remove outdated comment

* Attempt to fix texture import errors

---------

Co-authored-by: Timon Schelling <me@timon.zip>
2025-08-21 19:46:13 +00:00
Keavon Chambers
0e467907e2
Improve font import; replace Inconsolata with Source Code Pro; show third-party licenses in editor dialog (#3079)
* Improve font import; replace Inconsolata with Source Code Pro; show third-party licenses in editor dialog

* Code review
2025-08-21 11:57:04 -07:00
Dennis Kobert
e56f858ced Desktop: Implement GPU accelerated offscreen rendering and improve rendering efficency (#3056)
* WIP accelerade offscreen canvas implementation

* Implement vulkan dmabuf import

* Add fps printing

* Add feature gates

* Forgot to add file

* Experimental windows support

* Cast ptr to isize

* Remove testing chrome://flags url

* Experimental macos support for texture import

* Cleanup code and improve latency / frame pacing

* Add path for importing textures on windows through dx12

* Update doc comment

* Import textures through metal on macos

* Review cleanup

---------

Co-authored-by: Timon Schelling <me@timon.zip>
2025-08-21 10:09:38 -07:00
Dennis Kobert
97978c2491 Desktop: Change feature guard to Linux instead of Unix for Wayland 2025-08-21 10:08:29 -07:00
Timon
2c8913416d
Desktop: Move wrapper to separate crate (#3073)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
Move desktop wrapper to separate crate
2025-08-20 15:41:34 +00:00
Timon
30e5d66105
Desktop: Implement desktop wrapper module (#3039)
* Prototyping desktop wrapper api

* Separate into multiple modules

* Some fixup

* Reimplement most functionality with editor api

* Fix texture life time crashes

* Fix scale

* Implement editor wrapper message queue

* Improve performance

* Handle native messages directly without submitting to event loop

* Fix overlay latency

* Move editor message execution to executor allows no shared state in editor wrapper

* Small clean up

* Small cleanup

* Some renames

* Cleaning up desktop wrapper interface

* Fix formatting

* Fix naming

* Move node graph execution result handling to app

* Fix FrontendMessage RenderOverlays usage

* Reimplement file drop and clean up file import and open messages

* Remove dbg

* Post merge fix

* Review changes
2025-08-20 13:27:36 +00:00
Dennis Kobert
a70c48f69a
Use lyon_geom for intersection calculation of bezier segments (#3071)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* Add lyon_geom for cubic cubic intersections in he path bool crate

* Remove cubic line intersection for now
2025-08-20 13:59:11 +02:00
Timon
e70862b399
Desktop: Add File > Save As… (#3034)
* Make file name and document name identical

* Add save as action

* Fix test errors

* Add missing save as action

* Desktop fix drop file open document file message

* Address review comments

* Replace file save suffix with file extension

* Add comment specifying that the upload function takes a html input accept string

* Fix remove file extension in web

* Use let

* Don't show save as menu entry in web

* Don't add SaveDocumentAs in web

* Remove file extension on all open document file calls

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2025-08-20 10:09:01 +00:00
Dennis Kobert
7c30f6168b
Improve snapping performance (#3067)
* Use lyon_geom for intersection calculation of bezier segments

* Implement approximate nearest point calculation and loosen bounding boxes

* Add algorithm explanation

* Update editor/src/messages/tool/common_functionality/snapping/layer_snapper.rs

Co-authored-by: Keavon Chambers <keavon@keavon.com>

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-08-20 10:47:58 +02:00
Firestar99
b44a4fba1e
node-macro: cleanup ParsedField struct (#3064)
Some checks are pending
Editor: Dev & CI / build (push) Waiting to run
Editor: Dev & CI / cargo-deny (push) Waiting to run
* node-macro: cleanup `ParsedField` struct

* node-macro: fixup tests
2025-08-19 09:25:58 +00:00
Ciftci
36a1453d03
Add workaround for a Safari bug where our number input fields can't be released from click-and-drag (#3053)
Added fallback for Safari to trigger a pointerLockChange in case it doesnt fire automatically

Co-authored-by: seabeeberry <seri@Mac.fritz.box>
2025-08-18 22:30:18 -07:00