Commit Graph

2914 Commits

Author SHA1 Message Date
Keavon Chambers
ff59b0419e Add a 'Max Concavity' angle to the Convex Hull node for concave hulls
Dents whose boundary turns backward by no more than the angle are
flattened by the hull; deeper dents keep their original boundary. At the
maximum of 360 degrees the node produces the fully convex hull as before,
and at 0 degrees every dent survives. Bridges between separate subpaths
always apply, so disjoint islands stay connected and interior geometry
(such as holes) never survives at any setting.

The partial hull reuses the convex pipeline, keeping collinear hull
vertices so pockets (the boundary stretch each bridge spans, located by
gap matching along the subpath) can attach to them. Each pocket is
processed by a canonical deletion sweep that repeatedly removes the
cheapest reflex sample vertex whose bypassing chord stays on the empty
side of the boundary and within the angle budget, which handles nested
dents inherently and can never cut into material bumps. Surviving chords
are polished to exact tangencies with the same closed-form solves used
for hull bridges, and kept stretches are emitted as exact cuts of the
original segments.
2026-07-06 21:16:46 -07:00
Keavon Chambers
4169277508 Finish the convex hull node: in-repo algorithm, robustness, and tests
Replaces the WIP node crate, which depended on a convex_hull crate that
only existed outside the repository, with a self-contained implementation:

- The curved hull algorithm lives in vector-types' algorithms module. It
  splits curves at inflections and cusps into curvature-monotone arcs,
  discovers the boundary structure from a sampled polygonal hull, refines
  every transition to an exact tangency with closed-form quartic
  tangent-through-point solves, then emits the boundary as cuts of the
  original segments joined by straight bridge lines.

- The node moves into vector-nodes alongside the other 'Vector: Modifier'
  nodes, ported to the List/attributes model. It accepts Graphic[] or
  Vector[], wraps every subpath (open or closed) and free-floating anchor
  point across all items, and outputs a single world-space hull path.

- The boolean-union pre-pass is dropped as unnecessary: the hull of all
  segments equals the hull of their union, and the polyline connector it
  relied on lost floating points and mishandled open paths.
2026-07-06 19:24:11 -07:00
Dennis Kobert
0c216d2871 Add convex hull node 2026-07-06 19:23:55 -07:00
YohYamasaki
6a54dcb5da Remove the legacy Fill, Gradient, and PathStyle types now that paints live in attributes (#4297)
* Remove `Stroke.color`

* Remove legacy Gradient struct usage

* Fix gradient tool tests

* Remove `Fill` enum

* Fix direction of `gradient_orientation_rightward`

* Remove `Gradient` struct

* Remove `PathStyle` struct

* Fix old `VectorData` migration

* Refactor

- Remove unnecessary wrapper functions
- Use `as_ref` instead of `clone` for stroke if possible
- Comment cleanup

* Clean up stale style comments and bindings left by the paint attribute migration

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2026-07-04 23:08:06 -07:00
YohYamasaki
9f9899cfd0 Refactor the 'Fill' and 'Stroke' nodes to set "fill" and "stroke" attributes for paints (#4257)
* Allow using any graphics type for fill

* Adapt gradient/fill property panels and tools to handle List<T>

* Make the initial gradient transform covers the target's bounding box

* Introduce AnyGraphicListDyn to avoid combinatorial explosion

* Allow using any graphics type for stroke paint

* Add FIll node migration

* Add `for_each_vector_list_mut` instead of `set_paint_attribute`

* Adapt paint flow to read and write attributes instead of legacy Fill/Stroke.color

* Fix responsibilities of paint related node input setters

* Fix Morph by storing List<Graphic> for attributes rather than the concrete types

Store fill/stroke paints as List<Graphic> so Color/Gradient transitions
do not hit set_attribute_value_dyn's type-mismatch fallback to default paint.

* Preserve paint attributes in vector editing ops

* Enhance the clarity between direct and chained fill gradients

* Update demo arts

* Consolidate Fill node gradient appearance inputs

* Fix after the cubic review

* Revert "Consolidate Fill node gradient appearance inputs"

This reverts commit 9622feb20196e2c4da99e98ca95dcc2e34c2c98e.

* Replace AnyGraphicListDyn with generic paint connectors on the Fill and Stroke nodes

* Canonicalize paint attribute storage to List<Graphic> with a single write helper

* Fix Solidify Stroke missing fills stored in the legacy style

* Fix Solidify Stroke producing invisible strokes for legacy-only stroke colors

* Fix the initial gradient transform ignoring the bounding box's vertical extent

* Step paint at the morph midpoint instead of dropping it for unmixable pairings

* Remove migration-stage comments

* Clarify the initial gradient transform helper's doc and name

* Correct the bake_paint_transforms doc and prune dead tolerance arms

* Delete the unused Gradient::lerp

* Fix a comment typo

* Thread network paths through the legacy gradient bake so nested fills migrate

* Restore the legacy fill fallback in Expand Fill and Stroke

* Read gradient stops from the node's own input in the Fill properties panel

* Use the transform input constant instead of a hardcoded index

* Remove the unreachable wired color fallback in the Fill properties solid branch

* Narrow the fill overlay redraw check to actual fill inputs

* Coalesce the fill setter's graph runs into a single dispatch

* Position the Gradient Value node inserted for gradient stops

* Bake backup gradient placement during migration

* Persist pending gradient bakes so unfinished migrations retry on reopen

* Migrate the backup gradient's type and spread method

* Harden the gradient-migration pass against document switches and stale bakes

* Keep the Fill properties UI for layerless and nested Fill nodes

* Leave a wired gradient transform input connected instead of overwriting it

* Refuse to start a gradient chain ahead of existing layer content

* Decode a Fill node's gradient through one shared reader

* Nudge a degenerate bounding box so the Fill gradient transform stays invertible

* Broadcast Fill and Stroke paint with a single attribute-column pass

* Fix Morph stepping the target's stroke in near the source instead of the target

* Tidy conventions: clippy get_first, comment periods, sentence-case test messages

* Reattach the gradient orientation doc to its function

* Re-save demo artwork

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2026-07-04 23:08:21 +00:00
Keavon Chambers
f82b0a8fca Switch production builds from -Os to -Oz to avoid 25 MB deployment limit (#4309) 2026-07-04 14:25:38 -07:00
Dennis Kobert
540a4ff273 Integrate document-format storage into the editor (#4265)
* Integrate document-format storage into the editor

* Address review feedback: drop redundant clones and dedupe metadata traversal

* Extract DocumentHistory and move storage-metadata tests to their own file

* Extract storage diffing/IO, gate validation and .gdd save behind preferences, restructure tests

* Address PR review: save-format/path consistency, autosave persistence, and view-settings/diff fixes

* Skip storage remount on .gdd open and split value/timestamp drift in attribute diff

* Rename storage tests module and surface .gdd open failures with per-resource diff detail

* Add debug-menu toggle to hide the storage preferences section

* Hopefully fix async tests

* Shorten comments

* Fix tests

* Review

* Review

* Review

* Block on future mesages in tests

* Review

* Shorten comments

---------

Co-authored-by: Timon <me@timon.zip>
2026-07-04 19:27:00 +00:00
Timon
294952e152 Desktop: Use dirty rects for UI texture uploads (#4305) 2026-07-04 16:25:16 +00:00
Keavon Chambers
f05a644bd9 Revamp the syntax to #[hard(a..b)] and #[soft(a..b)] bounds on node definitions (#4307)
* Revamp the syntax to #[hard(a..b)] and #[soft(a..b)] bounds on node definitions

* Address review feedback: error on empty bounds ranges and remove redundant count clamps

* Fix NaN transform from Repeat Array with a count of 1

* Remove redundant manual clamps already enforced by #[hard(...)] bounds
2026-07-03 18:48:58 -07:00
Keavon Chambers
95c1ab81f3 Prep for the RC6 release of the desktop app latest-stable 2026-07-01 04:55:57 -07:00
Keavon Chambers
7ae7bda3d3 Add persistence to the collapsed state of Properties panel node sections (#4300)
* Add persistence to the collapsed state of Properties panel node sections

* Improve comments

* Fix generator node handling with #4299
2026-07-01 04:54:39 -07:00
Keavon Chambers
1648e33c1f Implement dragging to reorder Properties panel node sections (#4299)
* Implement dragging to reorder Properties panel node sections

* Code review
2026-07-01 03:39:52 -07:00
Timon
8a38af5be7 Rework clipboard handling to carry embedded resources across documents (#4296)
* Move clipboard code to its dedicated handler

* Adapt clipboard format to work with resources

* Restore visibility, lock, and collapse state when pasting layers

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2026-07-01 09:31:55 +00:00
Keavon Chambers
7c870d9426 Fix skewed linear gradient layers ignoring the horizontal shear axis in Vello 2026-06-30 21:48:51 -07:00
Timon
0882637801 Auto-recover from corrupt Wasm builds that emit undefined env imports (#4287)
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2026-06-30 22:07:17 +00:00
Timon
9626c047a4 Fix CI builds by pinning cargo-about for Windows and Mac 2026-06-30 21:40:18 +00:00
Keavon Chambers
3e674c939b Revamp the stand-in for embedded YouTube videos on the website 2026-06-30 01:42:40 -07:00
Keavon Chambers
2a3f1a12a8 Fix nondeterministic Vector point IDs from the 'As Vector' node 2026-06-29 23:52:51 -07:00
Timon
6ee0239b96 Desktop: Update CEF to 149 (#4286) 2026-06-29 15:25:30 +00:00
Keavon Chambers
244b25708d Add color picker gradient color stop duplication by holding Alt (#4291)
* Add color picker gradient color stop duplication by holding Alt

* Fix bugs

* Bug fix
2026-06-28 17:34:27 -07:00
Dennis Kobert
a979ccd5bd Add document-format RFC draft (#4264)
* Add document-format RFC draft

* Align document-format RFC with graph-storage implementation

* Update writing style

* Recharacterize resource source chain as LWW-element-set, not add-wins OR-set

* Add Rev identity rationale framed against Git, plus patch-id future item

* Correct RFC inaccuracies found in implementation audit

* Mark unimplemented retirement coarsening and leader election as future; fix resurrection mechanism

* Add hot-log to the on-disk payload list in the architecture diagram
2026-06-28 19:05:30 +00:00
Keavon Chambers
fa27d53b98 Add a Vite plugin to auto-prefix -webkit-user-select so it's not so often forgotten (#4288)
* Add a Vite plugin to auto-prefix -webkit-user-select so it's not so often forgotten

* Enforce a property boundary on the left
2026-06-28 00:20:26 -07:00
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