Commit Graph

1050 Commits

Author SHA1 Message Date
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
Keavon Chambers
a7171f5939 Stop flatten_graphic_list() from adding unused attributes (#4220) 2026-06-10 14:37:14 -07: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
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
85ee5e41b9 Fix strokes with inside/outside alignment not being selectable when above other layers (#4207) 2026-06-07 17:08:04 -07:00
Dennis Kobert
d5c67eeb55 Drop MemoHash's std Hash impl and route cache-identity hashing through CacheHash (#4209) 2026-06-07 17:49:56 +00:00
YohYamasaki
a3b62dac00 Make the Gradient tool work with gradient node chains feeding a Fill node (#4177)
* 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>
2026-06-06 03:23:14 +00:00
Timon
cd8ea1f554 Migrate fonts to be stored as resources (#4165)
* 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
2026-06-05 13:27:25 -04:00
Dennis Kobert
7b9c480a8d Make ResourceStorage trait &self-based and remove 'static requirement (#4188)
* Make ResourceStorage trait &self-based with elided-lifetime ResourceFuture

* Adress review comments
2026-06-01 10:37:05 +00:00
Timon
e32ff4b7f0 Make Resource aware of its own hash (#4187)
* Fix future message handler field name

* Add Resource::hash()

* Move all remaining resource types from core-types to graphene-resources

* Review
2026-05-31 23:08:01 +00:00
Timon
51427bef5f Fix CI profiling compile failure (#4184) 2026-05-31 20:32:34 +00:00
Timon
a40e0d2887 Use ResourceId for referring to Resources (#4176)
* 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
2026-05-29 10:56:32 +00:00
Timon
bbbe04903f Define data types for ID-based resource handling (#4168)
* Add resource lib

* rename ResourceSource to ResourceInput

* Rename ResourceInput -> DataSource and improve API

* Review

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2026-05-25 10:50:57 +00:00
Timon
c3b0c87cfe Antialias checkered artboard background edges (#4163)
* Antialias checkered artboard background edges

* Review
2026-05-22 16:48:05 +00:00
Timon
2770df7567 Implement content-addressed resource storage for raster images (#4148)
* Implement content-addressed resource storage

* Implement OPFS resource storage

* Remove ResourceStorage::read

* Review
2026-05-21 19:31:07 +00:00
Keavon Chambers
21d2994059 Fix 'Solidify Strokes' node to produce dashed segments in an ordered sequence per open subpath (#3820)
Fix the ordering of dashed segments of open paths with the 'Solidify Stroke' node
2026-05-17 10:56:40 -07:00
Timon
d5f0140f26 Upgrade WGPU and Linebender dependencies (#4154) 2026-05-17 15:36:59 +00:00
Keavon Chambers
256dd26b99 Recognize ExtractPosition/InjectPosition in the node macro context analyzer
Also, fix migration missing alias
2026-05-16 01:40:49 -07:00
Keavon Chambers
a56746c6bf Deprecate all usages of the Color struct representing gamma space values, fixing round-trip precision bugs (#4149)
* Deprecate all usages of the Color struct representing gamma space values, fixing round-trip precision bugs

* Code review fixes
2026-05-14 22:48:33 -07:00
gamma0987
456a7c868d Migrate iai-callgrind to the renamed successor gungraun (#4056)
* Add .nvim.lua to gitignore

* Migrate from iai-callgrind to the renamed successor gungraun

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2026-05-14 08:18:59 +00:00
Keavon Chambers
1c9c19a697 Simplify and standardize how data types are presented in user-facing strings (#4147)
* User-facing type formatting

* Parse unicode not ASCII chars
2026-05-14 00:56:43 -07:00
Keavon Chambers
4d5dce976e Replace the control bar's stroke weight with a full stroke properties popover (#4145)
* Replace the control bar's stroke weight with a full stroke properties popover

* Code review
2026-05-13 03:58:12 -07:00
Keavon Chambers
f6def3b911 Add icons for stroke align, cap, join, and order (#4136) 2026-05-11 03:53:38 -07:00
Keavon Chambers
a28b9437aa Rename the "Table" type to "List" everywhere (#4133)
* Rename the "Table" type to "List" everywhere

* Fix a few missed ones

* Re-save demo artwork
2026-05-09 01:33:39 -07:00
Keavon Chambers
6b3e4757de Rename the Table type's "rows" -> "items" and "columns" -> "attributes" everywhere (#4130)
* Rename TableRow -> Item

* Rename row -> item and column -> attribute throughout

* Fix a few missed ones

* Format
2026-05-08 23:11:33 -07:00
Keavon Chambers
cb21e5960b Remove serialization from Table<T> and make TaggedValue only store tooling/widget node inputs (#4129)
* 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
2026-05-08 16:11:25 -07:00
Keavon Chambers
9d876ab27d Add support for opening multiple selected files from disk (#4128) 2026-05-07 21:21:45 -07:00
Keavon Chambers
dff8ac5511 Remove code for the deprecated and unused Curve type (#4127)
* Remove the unused Curve type

* Fix frontend
2026-05-07 16:16:19 -07:00
Keavon Chambers
0834bff2da Make the Brush node store its cache as internal #[data] state instead of a serialized node input (#4126)
* Make the Brush node store its cache as internal #[data] state instead of a serialized node input

* Remove BrushCacheImpl::unique_id
2026-05-07 15:34:21 -07:00
Keavon Chambers
24c857ddc7 Make the Text tool control bar font family, style, and size sync with the selected layer (#4118)
* Fix contenteditable preview alignment

* Make the Text tool control bar font family, style, and size sync with the selected layer

* Tidying up
2026-05-06 20:50:41 -07:00
Keavon Chambers
2ae35a67e7 Add icons for text alignment/justification 2026-05-06 19:26:26 -07:00
Jatin Bharti
c0a8241f50 Add text last-line alignment modes for "Justify Center", "Justify Right", and "Justify All" (#4024)
* feat: Add justify proper alignments(right/left/centre/all)

* chore: fmt

* chore: refactor

* Cleanup

* Fix crash when changing selected layer's alignment from the Text tool control bar

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2026-05-06 19:16:19 -07:00
Keavon Chambers
023cf1bedd Fix the 'Flatten Vector' node losing child layer transforms for the editor tools (#4116) 2026-05-06 04:35:23 -07:00
Keavon Chambers
22a6e0d767 Preserve editor:layer_path through Table<Vector>::into_graphic_table() (#4113) 2026-05-06 02:21:45 -07:00
Keavon Chambers
9565d43481 Include stroke thickness in the bounds of document exports sized to fit "All Artwork" or "Selection" (#4112)
* Include stroke thickness in the bounds of document exports sized to fit "All Artwork" or "Selection"

* Code review fixes
2026-05-06 02:05:19 -07:00
Keavon Chambers
05f6138b65 Fix 'Offset Path' node crash on empty or zero-scaled geometry 2026-05-06 01:33:11 -07:00
Keavon Chambers
39a7c45ccd Fix rendering semi-opaque paths with "Outside" stroke alignment (#4110) 2026-05-06 01:26:43 -07:00
Keavon Chambers
269a217cf9 Fix Vello renderer cropping open paths with Inside-aligned strokes and an opacity or blend mode set (#4109)
* 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
2026-05-06 00:28:51 -07:00
Keavon Chambers
5becf132e7 Fix Vello renderer cropping wide miter joins and square caps (#4108)
* Fix renderer compositing layers cropping wide miter joins and square caps

* Fix double-scaled inflation on the Vello blend layer's clip rect
2026-05-05 22:02:02 -07:00
Keavon Chambers
644e9cf91e New nodes: 'Attach Attribute' and 'Read Attribute *' (#4100)
* New nodes: 'Zip Attribute' and 'Read Attribute {Vector, Number, Bool, String, Transform, Color, Blend Mode, Gradient Type, Spread Method}

* Cleanup

* Reduce type explosion
2026-05-05 04:03:41 -07:00
Keavon Chambers
9db91a1ac4 Use the SpectrumInput widget for the adjustment node Properties panel layouts (#4105) 2026-05-05 03:42:44 -07:00
Keavon Chambers
e59612c4ce Port the color picker popover to a Rust-defined layout (#4102)
* 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
2026-05-05 02:47:53 -07:00
Keavon Chambers
62203cb171 Fix the 'Solidify Stroke' node to snapshot its merged children 2026-05-03 21:30:49 -07:00
Keavon Chambers
21e5e06b0b Clean up document message wrappers around proto nodes so they're now used directly (#4101)
* Rename the 'Identity' node to 'Passthrough' internally

* Rename the 'Memoize'  node to 'Cache' internally

* Let skip_impl proto nodes auto-generate as document node definitions

* Remove the wrapper 'Passthrough' node from document_node_definitions.rs

* Remove the wrapper 'Cache' node from document_node_definitions.rs

* Remove the wrapper 'Monitor' node from document_node_definitions.rs

* Remove the wrapper 'Noise Pattern' node from document_node_definitions.rs

* Remove the wrapper 'Brush' node from document_node_definitions.rs

* Remove the wrapper 'Transform' node from document_node_definitions.rs

* Code review improvements

* Rename Cache node back to Memoize

* More code review
2026-05-03 19:26:36 -07:00
Keavon Chambers
b27b4c6be7 Remove gaps between text glyph bounding box click targets so selection is more reliable (#4098)
* Remove gaps between text glyph bounding box click targets so selection is more reliable

* Code review
2026-05-02 21:53:33 -07:00
Keavon Chambers
ebdb835890 Properly track the Text node's text frame via the attribute system to fix misalignment (#4097)
* Compensate for upstream row-0 transform absorption in viewport-space 'TransformSet'

* Add 'editor:text_frame' row attribute so the Text tool's drag cage tracks multi-row text

* "Separate Glyph Elements" -> "Separate Glyphs"

* Improve artboard migration robustness from older documents

* Code review

* Make the tools visualize the text frame based on attribute not upstream node
2026-05-02 21:04:30 -07:00
Keavon Chambers
de2ae29edd Improve click targets to use compound paths so interior negative space is excluded (#4096)
* Add ClickTargetType::CompoundPath variant for fill-rule-aware compound shape hit testing

* Generate one compound click target per Vector so glyph holes aren't treated as filled

* Fix insidenss logic
2026-05-02 18:47:43 -07:00
Keavon Chambers
325e9aff06 Add custom click targets to make Text node output easier to select (#4095)
* Stop pushing duplicate layer entries when re-clicking an already-selected layer

* Make Text node generate per-glyph bounding box click targets

* Show source-geometry outlines and aggregate all rows for layer click targets

* Strip 'editor:click_target' override on Path node so direct edits restore precise hit testing

* Fix inverting a zero-determinate transform
2026-05-02 18:12:42 -07:00