Commit Graph

2892 Commits

Author SHA1 Message Date
Keavon Chambers
cc465d6f2a Fix the 'Separate Subpaths' node dropping a layer's transform when it has no subpaths (#4289)
Fix the Separate Subpaths node dropping a layer's transform when it has no subpaths
2026-06-27 23:42:25 -07:00
Timon
21bf290013 Hide node parameters connected to a NodeInput::Scope in the Properties panel (#4284)
Hide inputs connected to a scope in properties panel
2026-06-26 09:48:14 +00:00
Timon
684496109a Fix a previewed node's dashed output wire appearing at the wrong position (#4282)
* Fix node graph connection to export in wrong place

Co-authored-by: James Lindsay <78500760+0HyperCube@users.noreply.github.com>

* Review

---------

Co-authored-by: James Lindsay <78500760+0HyperCube@users.noreply.github.com>
2026-06-26 09:43:00 +00:00
Timon
f3faefd460 Snap overlays to device instead of UI pixels on web (#4281)
Snap overlays to physical instead of logical pixels on web
2026-06-25 09:04:36 +00:00
Timon
6fb6e83d68 Desktop: Prefer Vulkan as the WGPU backend on Linux (#4270)
* Manual wgpu adapter selection

* Fall back to remaining adapters when the preferred one fails to initialize
2026-06-25 00:09:39 +00:00
Keavon Chambers
ebbbb6bd1b Fix the Shift-drag alignment guide anchoring to the prior selection instead of the dragged layer (#4278) 2026-06-23 02:28:06 -07:00
Dennis Kobert
03c33dc784 Fix error from running cargo check with a system global Cargo config.toml rustflags override (#4277)
Fix error caused by running cargo check in the workspace
2026-06-23 09:09:19 +00:00
jneem
57ee2b00ca Bump linesweeper to 0.4 (#4273)
* Bump linesweeper to 0.4

* Avoid crash if there's an indexing bug

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2026-06-23 00:15:55 +00:00
Keavon Chambers
1158d93bb4 Migrate legacy gradients via an isolated measurement pre-pass (#4268)
* Migrate legacy gradients via an isolated measurement pre-pass

Convert legacy bounding-box-relative Fill::Gradient values to absolute
space on document load by measuring each fill's evaluated geometry,
rather than walking each layer's primary flow. The pre-pass scans the
whole root network so fills on secondary branches (e.g. a Copy to Points
instance) and fills in hidden, disabled, or orphaned branches are all
found, redirecting the document export to each fill in turn to force its
branch to evaluate and reading its geometry back from the inspect result.

With every legacy gradient converted before any render, the legacy
bounding-box render path is removed: the ATTR_GRADIENT_LEGACY marker, the
renderer's legacy brush branch, and fill_to_graphic_list's bbox bake all
go away. Gradients nested inside subgraph node networks are out of scope
and warned about.

* Address review: harden gradient migration against stalls and document switches

- Advance the queue on dispatch early returns (missing export or channel
  send error) so a failure can't leave the migration permanently stuck
  with the document unable to render.
- Tag the migration with its DocumentId: cancel-and-restart when a
  different document's migration is requested, and only apply a
  measurement to the active document's in-progress migration, so
  switching documents mid-migration can't stall or cross-apply.

* Remove nested network non-migration warning

* Cleanup

* Also add migrations for Fill node backup colors

* Apply migrations to the demo art
2026-06-22 16:59:22 -07:00
Keavon Chambers
c1fa8ba8da Move NumberInput.svelte input processing from JS to Rust (#4274)
* Move NumberInput.svelte input processing from JS to Rust

* Fix edge cases
2026-06-22 14:57:11 -07:00
Timon
f798b48b83 Move branding and package install into cargo-run (#4266)
* Move branding asset fetch into cargo-run

* Move frontend npm install into cargo-run

* Rename branding::ensure to branding::setup

* Wording nits

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2026-06-22 20:21:46 +00:00
Keavon Chambers
b286e89746 Make the Pen tool's preview segment follow the cursor during a G/R/S handle transform (#4269) 2026-06-22 01:37:23 -07:00
Timon
d753ce26f7 Make the cargo-run tool auto-install its wasm-opt build dependency (#4256)
* Allow auto downloading wasm-opt

* Fix for mac

* Review
2026-06-21 20:17:54 +00:00
Timon
a72ac39059 Replace the dev server's wasm-pack, cargo-watch, and concurrently tools with custom cargo-run tooling (#4254)
Replace wasm-pack, cargo-watch and concurrently with custom build tooling

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2026-06-21 12:48:31 -07:00
Keavon Chambers
1f05000238 Exclude viewport zoom from influencing scale in the Transform node set by the drawing tools (#4260)
* Keep viewport zoom out of drawing tools' Transform node

* Simplify window-aligned transform helpers and fix spline DragStop fallback
2026-06-21 12:09:21 -07:00
Dennis Kobert
b45cc312dd Add support for opening GDD documents from the CLI (#4262)
* Wire document-format into graphene-cli

* Support loading both legacy and new graphite files in the cli

* Address PR review: propagate CLI errors and use dyn resolver

* Fix CLI network wrap + preprocessor ordering

* Cleanup preprocessor

* Remove unused import
2026-06-21 18:17:01 +02:00
Dennis Kobert
de11d29d8e Add document-format crate (#4234)
* Add document-format crate

* Adapt document-format to merged graph-storage and consolidate errors

* Fix resource write ordering, codec error masking, and export docs

* Remove document-format RFC; tracked in a dedicated PR

* Restructure document-format into gdd/persist/export/resource modules

Split the 963-line lib.rs by responsibility: persist path into persist.rs, resource I/O into resource.rs, export engine into export.rs. Rename the GddV1 layout struct to GddV1Layout and add a GddV1 = Gdd<GddV1Layout> alias.

* Feature-split document-format and graph-storage for minimal builds

* Address PR review: O(1) history-delta lookup and no-default-features test build

* Address PR review: propagate apply_hot_op persist error and assert resource hash

* Make decompression from archive streaming

* Share archive export body between export and export_to_bytes

* Review cleanup

* Export documents with un-retired hot ops losslessly

* Persist last_broadcast_rev in session.json, drop unused last_retired_at

* Move peer_id from manifest to session.json

* Rename gesture to interaction in document-format storage layer
2026-06-21 12:35:47 +00:00
Keavon Chambers
194c5b2222 Fix the Select tool's transform dial not working on rotated layers (#4259) 2026-06-20 15:05:30 -07:00
Keavon Chambers
e8f9413e03 Fix double-clicking a gradient stop under snapping influence not opening color picker (#4258)
* Fix double-clicking a gradient stop under snapping influence not opening color picker

* Simplify
2026-06-20 14:48:26 -07:00
YohYamasaki
7bc0f042ce Transition gradients from bbox-relative to document-absolute space (#4241)
* Use userSpaceOnUse to render gradient on SVG

* Allow non-uniform transform to radial gradient on vello

* Position gradients absolutely instead of by bbox

* Fix SVG import by removing multiplication of bound's inverse transform

* Represent sheared linear gradients via their equivalent gradient line

* Migration

* Fix migration for radial (elliptical) gradients

* Fix boolean operation gradients

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2026-06-20 21:21:28 +00:00
Timon
674b3a213f Extract pipelines from WgpuExecutor into scope-provided pipeline nodes (#4210)
* Implement generic pipeline caching

* Fix WIP

* Fix

* Fix

* Fix

* Fix bench

* Migrations

* Review
2026-06-19 21:20:25 +00:00
YohYamasaki
3bf32443ed Improve graphic List<T> fill/stroke paint handling (#4240)
* Fix empty color list ignoring paint target

* Avoid cloning renderable lists for paint presence checks

* Refactor after code review by gemini

* Make singular matrix check more robust

* Extract transform_is_invertible helper; clarify has_paint_at docs

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2026-06-19 20:42:49 +00:00
Jatin Bharti
5f100946f2 Add String[] as a graphic type for typography (#4141)
* feat: Render List<String> as raw paths in SVG and Vell mode

* chore: code review

* chore: change the hardcoded layout bounds to parley's

* chore: code review

* feat: Split text node to text_layer and text_to_vector node

* fix: CI fail because of difference in nature of Mac and github action

* chore: fix

* chore: replace FontStack as it got removed in parley 0.9

* chore: fmt

* chore: migrate the rendering as of new resource architechture

* chore: add text_layer node to text tool for testing

* code review

* Make boolean ops support the Text type

* chore: Move fallback_font_resource authority from editor to text node

* Fix 'Text Layer' node missing font dropdown

* Change node doc comments from Vec<T> to T[]

* Add migrations from the old Text node to Text -> Text to Vector

* Consolidate

* Rename the text attributes and reorder tilt to come before max_width/height

* Detect legacy Text nodes in the split migration by their trailing separate_glyphs input

* Code review

* Frame Text layer thumbnails by laying out their text for bounds

* Give Text layers click targets and selection outlines via collect_metadata

* Route Text tool through Text to Vector with fill, fixing editing-preview placement

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2026-06-19 19:39:52 +00:00
Keavon Chambers
13abf9fa8c Make vector mesh branch detection and free-point click targets O(n) instead of O(n^2) (#4255)
* Make is_branching and free-point click targets O(n) instead of O(n^2)

* usize -> u8

* Fix profiling CI treating performance improvements as regressions
2026-06-18 21:52:02 -07:00
Timon
236ab7a11c Move TaggedValue::ResourceHash to macro definition site (#4232) 2026-06-19 01:36:45 +00:00
Keavon Chambers
5b008936d2 Make the node graph's "Merge Selected Nodes" target the right-clicked node, and fix it crashing (#4252) 2026-06-17 22:31:06 -07:00
Keavon Chambers
9a9436c5b9 Fix "Untitled Document {N}" numbering progression when another doc includes that substring (#4253)
* Fix "Untitled Document {N}" numbering progression when another doc includes that substring

* Fix names with non-numeric suffixes blocking the base name
2026-06-17 22:00:31 -07:00
Dennis Kobert
b1d8ac0e64 Add History type and merge-commit model to graph-storage (#4238)
* Add History type and merge-commit model to graph-storage

* Add History::merge with canonical-sort convergence to graph-storage

* Append merge delta without re-sorting the whole history

* Resurrect across merges by searching all ancestors, not the primary chain
2026-06-16 15:02:48 +02:00
Keavon Chambers
a5e7a4f905 Simplify comments on the Color struct 2026-06-15 22:20:31 -07:00
Keavon Chambers
9f01e54a9b Add layer and artboard nudge resizing (#4242)
* Add layer and artboard nudge resizing

* Improve bounding box validation for layer resizing to ensure only finite bounds are considered
2026-06-15 21:37:40 -07:00
Keavon Chambers
8b8cac23d1 Remove layer and artboard nudge resizing 2026-06-15 18:51:15 -07:00
Keavon Chambers
82879c7a08 Simplify helper function signatures in document_message_handler.rs 2026-06-15 17:11:01 -07:00
Keavon Chambers
3414b32d5e Remove dead code from the unused curves adjustment widget 2026-06-15 14:46:43 -07:00
Keavon Chambers
971d1fb16b Fix loading documents saved before #4129 with raster images appearing missing 2026-06-15 11:19:21 -07:00
Timon
077d11bdba Resolve scopes before flattening network (#4235)
* Compiler changes

* Run preprocessor on wrapping network

* Remove test nodes

* FIx

* move generate_node_paths call to compiler

* Make it more obvious what input is set to
2026-06-15 11:19:21 -07:00
Keavon Chambers
34e0fd7757 Replace the 'Vec2 to Point' node with automatic conversion machinery (#4236)
* Replace the 'Vec2 to Point' node with an 'As Vector' node and automatic conversion

* Accept a Vec2 as content for the Wrap Graphic node

* Rename the type-assertion nodes from 'To' to 'As'

* Fix the Transform node reversing a Vec2 input's direction

* Fix text migration bug
2026-06-14 21:44:08 -07:00
Dennis Kobert
b56af15e5e Add graph-storage crate (#4198)
* Add graph-storage crate

* Split graph-storage lib.rs into smaller modules

* Make graph_craft/core_types dependency optional

* Fix CRDT correctness issues flagged in graph-storage PR review

* Treat trailing empty export slots as value-equal in Network::value_equal

* Address graph-storage review: parameterize CrdtError, reject hot-log corruption, drop LamportClock Default

* Address graph-storage review: fix root-delta history walk, validate cross-network refs, make compute_deltas deterministic, harden Priority, index nodes by network

* Address graph-storage review: sort sources on deserialize, treat inputs_attributes length as structural, dedupe demo-artwork loader

* Add opt-in Delta rev validation, dedup resource sources on deserialize, fix doc grammar

* Persist scope injections through storage; harden gesture-end and embedded-source checks

* Review

* Review

* Review

* Use new types for NodeId and NetworkId

* Adress minor review comments

---------

Co-authored-by: Timon <me@timon.zip>
2026-06-13 16:47:04 +00:00
Keavon Chambers
cde8dd78e6 Remove stray float literal .0 suffixes in lieu of just ending with a point (#4233)
Remove the .0 suffix on floats in lieu of just ending with a point
2026-06-12 19:47:36 -07:00
YohYamasaki
2b8ef42086 Add renderer support for painting vector with "fill" and "stroke" attributes with graphic List<T> types (#4111)
* Add conversion from Fill to Table<Graphic>

* Refactor Vector vello renderer for Gradient / Color

* Refactor Vector SVG renderer for Gradient / Color

* Fix conflicts

* Add basic clipping-based fill for SVG rendering

* Use Cow to avoid cloning graphic list for fill

* Cleanup for Cow usage

* format code

* Use `<pattern>` instead of `<clipPath>` for clip

This simplifies the future implementation of clipping-based rendering
for strokes, as the stroke does not support the use of a clip path but
rather paint sources from a paint server.

* Move svg pattern rendering function to RenderExt

* Fix comment

* Fix empty fill list rendering as default black

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* Move opaque check function to Graphic impl

* Add color converter and debug node to use graphic

* WIP: Use List<Graphic> to render Color & Gradient

* Use `Arc<List<Vector>>` for vector_data metadata

This exposes List's attributes to message handlers, enabling them to
access the necessary attribute data such as ATTR_STROKE_PAINT_GRAPHIC
as `Fill` and `Stroke` will not have paint information in the future.

* Recurse opacity checks on nested `Graphic`

Also extracts `fill_graphic_list_at` /
`stroke_paint_graphic_list_at` to share the row-attribute
lookup across the existing call sites.

* Fix fill and stroke visibility check degradation

* Fix clipping based stroke paint positioning

* Refactor vello renderer for stroke to use graphic

* Reduce `Fill` / `Stroke.color` to `List<Graphic>` allocations

* Revert "Use `Arc<List<Vector>>` for vector_data metadata"

This reverts commit 4285243a5d

* Expose paint row attributes as dedicated metadata for vectors

Add `fill_attributes` / `stroke_paint_attributes` to `DocumentMetadata`
so the `ExpandFillStrokeOnSelectedLayers` handler can read row paint
visibility without exposing entire `List<Vector>`.

* Fix transparency check to consider fill opacity

* Fix consistency of gradient placement for SVG stroke

* Rename `stroke_paint_..` to `stroke_..`

* Remove debug nodes

* Allow to use any graphic type without casting

* Rename `fill_graphic` / `stroke_graphic` to `fill` / `stroke`

* Fix SVG pattern placement when stroke transform differs from item transform

* Fix click target fill check for empty list in graphic

* Fix blank fill/stroke attribute masking legacy style

* Fix SVG's paint order trick for vector/raster fills

* Add zero-division guard for pattern wraparound prevention

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2026-06-12 23:29:34 +00:00
Timon
e524dff1a7 Add node macro support for injecting nodes into global scope (#4221)
* Macro support

* Preprocessor support

* Allow Cow str as scope name

* Use Passthrough node to work around compiler auto wrapping the producer node and invalidating the node id

* Stable NodeIds

* Less hacky but with bad performace

* Remove Cow from RegistryValueSource::Scope

* Connect scope injections to the inner network export

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2026-06-11 18:14:58 +00:00
Timon
05d3d66587 Desktop: Block network requests in CEF that are not explicitly allowlisted (#4225) 2026-06-11 15:32:53 +00:00
YohYamasaki
26a0b901d4 Unify the gradient chain lookup used by the stops and attribute reads (#4223) 2026-06-11 05:36:43 +00:00
Keavon Chambers
97324cd852 Fix the Gradient tool breaking the layer deletion hotkey (#4224)
* Fix the Gradient tool breaking the layer deletion hotkey

* Fix
2026-06-10 22:32:39 -07:00
Keavon Chambers
f658665d4a Fix CI deploying all PR preview builds to dev.graphite.art
Fixes a regression introduced in 9dccc526b
2026-06-10 16:18:41 -07:00
Keavon Chambers
a7171f5939 Stop flatten_graphic_list() from adding unused attributes (#4220) 2026-06-10 14:37:14 -07:00
Vishnu Tejas
f2c83d2278 Desktop: Fix double-clicking top bar not toggling maximize on Linux (#3940)
Fix double-clicking top bar not toggling maximize in linux
2026-06-10 10:19:19 +00:00
Keavon Chambers
863b1f9993 Fix opacity attributes from defaulting to 0 rather than 1 (#4219)
* Fix opacity attribute padding to default to 1 instead of 0

* Perf fixes
2026-06-09 23:00:57 -07:00
Keavon Chambers
02a40a860f Add a wave propagation ripple effect to the website navbar (#4150)
* WIP: Website navbar ripple

* Fix performance and other bugs

* Make the navbar ripple's active button explicitly inert
2026-06-08 23:15:12 -07:00
Keavon Chambers
b4e04e616a Fix the SVG renderer not representing skewed raster images (#4218)
Fix the SVG renderer not skewing raster images to fit their bounds
2026-06-08 21:28:38 -07:00
Keavon Chambers
bc1f63ccc6 Add Alt+drag layer duplication to the Layers panel (#4216)
* Add Alt+drag layer duplication to the Layers panel

* Code review
2026-06-08 21:08:16 -07:00