* 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
* 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
* 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>
* 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>
* 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
* 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
* 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>
* 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>
* Add Gradient node
* Add support of new Gradient node for Gradient tool
* Adapt gemini reviews
* Add tests
* Bring back visibility check
* Remove the 'Gradient' node since it's unwanted after all
* Formatting
---------
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* Good start
* Impl
* allow responses.add(async { Message::NoOp });
* Fix
* Cache font blob in text node
* Refactor font handling to use Font struct direcly
* Fix fmt
* Embedd Font Resources by default
* Review
* Review
* Cache font info based on ResourceHash
* Use ResourceId for referring to Resources
* Use Doc
* use error for preprocessor ResourceId replacement failure
* Keep hashes in DocumentInfo
* Migrate with less mem copy
* Global ResourceMessage -> ResourceStorageMessage
* Add document ResourceMessage
* Move embedding logic
* Fix
* Cleanup
* Review
* Fix
* Add TaggedValue::TypeDefault to avoid baking placeholder Tables into saved documents
* Add TaggedValue::TypeDefault to avoid baking placeholder Tables into saved documents
* Migrate empty Vector/Raster/Graphic/Artboard placeholder values to TypeDefault on load
Documents written before the TypeDefault mechanism existed have empty Table<Vector>/<Raster>/<Graphic>/<Artboard> values baked into every unwired exposed input. Walk each migrated node's inputs and rewrite any such placeholder NodeInput::Value into the equivalent NodeInput::type_default, so re-saved documents shed the placeholder payloads. Marked with a TODO for eventual removal once enough documents have been re-saved.
* Re-save demo artwork
* Remove Graphic and Artboard placeholder containers from TaggedValue
* Remove Raster placeholder TaggedValue variant
* Simplify document migration
* Remove Vector placeholder TaggedValue variant
* Remove NodeIdTable from the TaggedValue
* Remove StringTable from the TaggedValue
* Remove F64Table in place of F64Array in TaggedValue
* Replace TaggedValue::Color(Table<Color>) with ::Color(Option<Color>)
* Replace TaggedValue::GradientTable(Table<GradientStops>) with ::Gradient(GradientStops)
* Replace TaggedValue::BrushStrokeTable(Table<BrushStroke>) with ::BrushStrokes(Vec<BrushStroke>)
* Make TaggedValue::DocumentNode runtime-only with TypeDefault placeholder
* Make TaggedValue::ContextFeatures runtime-only
* Remove Serialize/Deserialize from Table<T>
* Add a widget for TaggedValue::BrushStrokes to visualize strokes and samples
* Define a reusable list of TaggedValue::TypeDefault types for its generated methods
* Re-save demo artwork
* Fix blend layers wrongly cropping Inside-aligned strokes on open paths
* Skip the closed-subpath check when stroke alignment can't apply
* Compute `can_draw_aligned_stroke` once and share it with the blend layer
* Use the actual axis scale, not the column-vector diagonal, when sizing stroke clip rects
* Fix under skew
* Break out VisualColorPickersInput.svelte
* Break out ColorComparisonInput.svelte and ColorPresetsInput.svelte
* Add backend definitions and plumbing for the 4 new widgets
* Port the ColorPicker.svelte layout and business logic to Rust
* Port more ColorComparisonInput.svelte logic to Rust
* Port more SpectrumInput.svelte logic to Rust
* Port more frontend logic to Rust
* Code review
* Code review
* Fix some CSS