Commit graph

592 commits

Author SHA1 Message Date
indierusty
5915b2de1f fix division by zero in 'Repeat' node impl when count is exactly one 2025-06-28 11:22:11 +05:30
indierusty
60d11c2abe refactor area node 2025-06-28 10:36:13 +05:30
James Lindsay
532e913017
Fix DropdownInput widget not reactively updating when its content changes (#2770)
* Improve reactivity of DropdownInput.svelte

* Fix formatting lint

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-28 02:59:03 +00:00
James Lindsay
62c7f88f5b
Fix incorrectly calculating nonzero-area bounding boxes for empty raster images (#2772)
No bounding box for empty rasters

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-27 19:37:37 -07:00
Dennis Kobert
357e77077d
Only compute bounding box for layers being rendered by Vello when actually used (#2771)
Only compute bounding box for vello when it is actually used

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-27 19:06:52 -07:00
Firestar99
ecd7999ca7
Extract gmath_nodes from gcore::ops, create mods debug and extract_xy (#2764) 2025-06-28 00:04:24 +02:00
Firestar99
9c4ab34a58
Extract gsvg_renderer from gcore, remove gcore/vello feature (#2760)
Extract `gsvg_renderer` from `gcore`, remove `gcore/vello` feature
2025-06-27 13:47:46 +00:00
Firestar99
ffc6c5532b
Extract gpath_bool from mod gstd::ops path_bool-related nodes (#2762)
* cargo shear

* Extract `gpath_bool` from `mod gstd::ops` path_bool-related nodes
2025-06-27 13:12:08 +00:00
Firestar99
d581319ee8
Prep gcore splitup 2: Vector extension traits (#2759)
* extension trait for `MergeByDistance::merge_by_distance_*`

* extension trait for `VectorData::append_bezpath`

* extension trait for `HandleId::set_relative_position`

* remove unreferenced rust files
2025-06-27 12:30:12 +02:00
Firestar99
2ddae98bcf
Prep gcore splitup: move various symbols into their own modules (#2746)
* move `trait AsU32` from `gcore::vector::misc` to `gcore`

* move blending and gradient to their own modules

* fix unused warnings

* move `Quad`, `Rect` and `BBox` to `gcore::math`

* extract `ReferencePoint` and transform nodes from `transform`

* move color-related code to `mod color`

* fix unused warning in test code

* move blending-related nodes and code to `mod blending_nodes`

* move ClickTarget code to `mod vector::click_target`
2025-06-27 09:54:34 +00:00
0SlowPoke0
d8d2a51926
Refactor shape gizmo interactivity to support future shape tools (#2748)
* impl GizmoHandlerTrait,Gizmo-manager and add comments

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-26 22:34:36 -07:00
Keavon Chambers
1875779b0a Remove dead code for Imaginate 2025-06-26 18:46:46 -07:00
Dennis Kobert
a40a760f27
Add automatic type conversion and the node graph preprocessor (#2478)
* Prototype document network level into node insertion

* Implement Convert trait / node for places we can't use Into

* Add isize/usize and i128/u128 implementations for Convert trait

* Factor out substitutions into preprocessor crate

* Simplify layer node further

* Code review

* Mark preprocessed networks as generated

* Revert changes to layer node definition

* Skip generated flag for serialization

* Don't expand for tests

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-26 16:10:14 -07:00
Priyanshu
86da69e33f
Fix 'Morph' node lerping the target paths to its end point instead of start point (#2754)
* fix lerping the target paths to the point at the end of path instead of the start.

* comment

* append a MoveTo element first if the bezpath is empty

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-26 07:44:22 +00:00
Keavon Chambers
02afd08c80 Fix 'Scatter Points' node double transformation of points and remove segments connecting the points 2025-06-26 00:19:49 -07:00
Ahmed Moharram
504af4e68d
Rename 'Sample Points' node to 'Sample Polyline' and add a parameter spacing based on separation or quantity (#2727)
* Added Count point Radio button to property pannel

* Implemented on Count radio button functionality

* Fixed linting and Title case problem

* Fixing more linting problem

* Instance tables refactor part 8: Make repeater nodes use pivot not bbox and output instance type not group; rename 'Flatten Vector Elements' to 'Flatten Path' and add 'Flatten Vector' (#2697)

Make repeater nodes use pivot not bbox and output instance type not group; rename 'Flatten Vector Elements' to 'Flatten Path' and add 'Flatten Vector'

* Refactor the 'Bounding Box' node to use Kurbo instead of Bezier-rs (#2662)

* use kurbo's default accuracy constant

* fix append_bezpath() method

* refactor bounding box node

* fix append bezpath implementation.

* comments

---------

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

* Add overlays for free-floating anchors on hovered/selected vector layers (#2630)

* Add selection overlay for free-floating anchors

* Add hover overlay for free-floating anchors

* Refactor outline_free_floating anchor

* Add single-anchor click targets on VectorData

* Modify ClickTarget to adapt for Subpath and PointGroup

* Fix Rust formatting

* Remove debug statements

* Add point groups support in VectorDataTable::add_upstream_click_targets

* Improve overlay for free floating anchors

* Remove datatype for nodes_to_shift

* Fix formatting in select_tool.rs

* Lints

* Code review

* Remove references to point_group

* Refactor ManipulatorGroup for FreePoint in ClickTargetGroup

* Rename ClickTargetGroup to ClickTargetType

* Refactor outline_free_floating_anchors into outline

* Adapt TransformCage to disable dragging and rotating on a single anchor layer

* Fix hover on single points

* Fix comments

* Lints

* Code review pass

---------

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

* Add anchor sliding along adjacent segments in the Path tool (#2682)

* Improved comments

* Add point sliding with approximate t value

* Add similarity calculation

* Numerical approach to fit the curve

* Reliable point sliding for cubic segments

* Fix formatting and clean comments

* Fix cubic with one handle logic

* Cancel on right click and escape

* Two parameter optimization

* Esc/ Right click cancellation

* Code review

* Fix dynamic hints

* Revert selected_points_counts and fix comments

* Code review

---------

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

* Fix Sample Points node to avoid duplicating endpoints instead of closing its sampled paths (#2714)

* Skip duplicate endpoint and close sampled paths in Sample Points node
Closes #2713

* Comment

---------

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

* Implemented on Count radio button functionality

* Fixed linting and Title case problem

* The sample count can now work with adaptive spacing

* Readying for production

* Rename to 'Sample Polyline' and add migration

* Upgrade demo artwork

* Add monomorphization

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Priyanshu <indierusty@gmail.com>
Co-authored-by: seam0s <153828136+seam0s-dev@users.noreply.github.com>
Co-authored-by: Adesh Gupta <148623820+4adex@users.noreply.github.com>
Co-authored-by: Ezbaze <68749104+Ezbaze@users.noreply.github.com>
2025-06-25 20:14:08 -07:00
Keavon Chambers
4a65ad290c Fix 'Boolean Operation' node merge-by-distance post-processing
Fixes #2750
2025-06-24 18:23:09 -07:00
Keavon Chambers
11ba2cc0fe New node: 'Split Segments' 2025-06-24 04:55:27 -07:00
Keavon Chambers
fdb09e334b Improve the categorization across many nodes 2025-06-23 18:52:05 -07:00
Ezbaze
2ec0ff38f3
Improve node creation menu and categorization (#2719)
* Change node categories

Signed-off-by: ezbaze <rybitwamateusz3@gmail.com>

* Restore Ezbaze's other work that was lost in the rebase

---------

Signed-off-by: ezbaze <rybitwamateusz3@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-23 18:51:16 -07:00
Firestar99
0e8eb481bf
Extract gapplication_io from gcore (#2742)
move `gcore::application_io` into the new crate `gapplication-io`, remove features `wasm` and `wgpu` from `gcore`
2025-06-23 11:35:14 +02:00
Keavon Chambers
ae88f4a3de Replace all hard-coded magic number node input indices with *Input::INDEX constants 2025-06-22 23:18:34 -07:00
Priyanshu
930278128d
New nodes: 'Path Length', 'Count', and 'Split Path' (#2731)
* impl path length node

* test 'Path Length' node implementation

* improve test

* impl 'Count' node to return the number of instance in a VectorDataTable instances

* impl 'Split Path' node

* don't split if t is close of 0 or 1 or the bezpath is empty

* write comments

* preserve the style on vector data in 'Split Path' node implementation

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-23 04:59:25 +00:00
Keavon Chambers
b5975e92b2 Combine 'Merge by Distance' nodes with a choice of algorithm; clean up 'Boolean Operation' node result with merge-by-distance 2025-06-22 04:22:39 -07:00
James Lindsay
4344f28909
Reduce development environment warnings and remove DWARF debug symbols (#2741)
* Ignore tauri gen

* Deny warnings on CI

* Fix all warnings in current nightly rustc

* Disable DWARF debug info for development builds

* Fix typo

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-22 03:10:25 -07:00
Firestar99
e520c21b66
Remove the serde feature and instead just always require it (#2737)
workspace: remove feature `serde`, always require it instead
2025-06-21 16:52:47 -07:00
Firestar99
ca5ca863cc
Unify feature dependencies with workspace dependencies (#2736)
* graph-craft: fix direct wasm build

* graph-craft: fix no serde feature failing to compile

* graph-craft: make wgpu-executor properly optional

* workspace: unify `image` formats in workspace

* workspace: turn most dependencies into workspace deps, no actual changes

* workspace: unify dependency features in workspace dep
2025-06-21 16:26:25 -07:00
Firestar99
990d5b37cf
Bulk gcore cleanup, replace core and alloc with std (#2735)
* gcore: replace `core` and `alloc` paths with `std`

* node-graph: remove unnecessary path prefix

* gcore: remove most `#[cfg(target_arch = "spirv")]`, keep some potentially useful ones

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-21 23:08:33 +00:00
Firestar99
34dced38ba Make gcore a std library and remove std, alloc, and more unused features (#2724)
* gcore: remove features `std`, `alloc`, `gpu` and `reflections`, now always available

* gcore: remove non-working features `kurbo` and `log`
2025-06-19 20:28:17 -07:00
Firestar99
13226f7049 Re-export all of gcore in gstd and rename 'Image' node to 'Image Value' (#2733)
* rename `image` node to `image_value`

* reexport the entirety of `gcore` in `gstd`
2025-06-19 20:28:17 -07:00
Firestar99
68985868fa Fix profiling CI action failing (#2734) 2025-06-19 20:28:17 -07:00
Firestar99
14d90195ad Remove unused dependencies from the Cargo.toml files via cargo shear (#2723)
* cargo shear ignore rules

* cargo shear

* cargo shear manual dependency removal

* cargo shear: ignore editor in proc-macros
2025-06-19 20:28:17 -07:00
Firestar99
3489f9ddb1 Bulk remove old code for legacy GPU node implementations (#2722)
* fix warning in node-macro

* remove crates `gpu-executor`, `gpu-compiler`, `compilation-client` and `compilation-server`

* remove `wgpu-executor::executor`

* .gitignore .idea/
2025-06-19 20:28:17 -07:00
Priyanshu
d721bca85f Fix 'Solidify Stroke' node not appending elements in the BezPath after the first ClosePath element (#2732)
Issue:
Previously the `AppendBezpath::append_bezpath()` method didn't append the elements after the first `ClosePath` element in the given BezPath, but the Bezpath can contain more than one path. The 'Solidify Stroke' node creates at least two paths, but the `append_bezpath` method only appends the first path, and hence 'Solidify Stroke' didn't work correctly.

Fix:
Now `AppendBezpath::append_bezpath()` appends all the paths in the given BezPath, which also fixes the 'Solidify Stroke' node.
2025-06-19 20:28:11 -07:00
Firestar99
006209c5d0 Put all #[test] in a mod tests (#2728)
workspace: put all `#[test]` in a `mod tests`
2025-06-19 20:25:58 -07:00
mTvare
e238753a35 Implement clipping masks, stroke align, and stroke paint order (#2644)
* refactor: opacity + blend_mode -> blend_style

* Add code for clipping

* Add alt-click masking

* Clip to all colors. Fill option

* Fix undo not working. Fix strokes not being white

* Allow clipped to be grouped or raster

* Switch to alpha mode in mask-type

* add plumbing to know if clipped in frontend and add fill slider

* Attempt at document upgrade code

* Fix fill slider

* Add clipped styling and Alt-click layer border

* Use mask attr judiciously by using clip when possible

* Fix breaking documents and upgrade code

* Fix fixes

* No-op toggle if last child of parent and don't show clip UI if last element

* Fix mouse styles by plumbing clippable to frontend

* Fix Clip detection by disallowed groups as clipPath according to SVG spec doesn't allow <g>

* Add opacity to clippers can_use_clip check

* Fix issue with clipping not working nicely with strokes by using masks

* Add vello code

* cleanup

* Add stroke alignment hacks to SVG renderer

* svg: Fix mask bounds in vector data

* vello: Implement mask hacks to support stroke alignment

* Move around alignment and doc upgrade code

* rename Line X -> X

* An attempt at fixing names not updating

* svg: add stroke order with svg

* vello: add stroke order with by calling one before the other explicitly

* fix merge

* fix svg renderer messing up transform det

* Code review; reorder and rename parameters (TODO: fix tools)

* Fixes to previous

* Formatting

* fix bug 3

* some moving around (not fixed)

* fix issue 1

* fix vello

* Final code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 19:11:01 -07:00
Albar
643d7b4432 Add the unit, display_decimal_places, and step parameter widget macro attributes (#2706)
* UI working for spacing enum.

* Implementations.

* UI working for spacing enum.

* Undo all changes.

* unit, display_decimal_places, and step macro implementation.

* Fixing tests.

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 19:01:58 -07:00
Ezbaze
aa3c214bf7 Fix Sample Points node to avoid duplicating endpoints instead of closing its sampled paths (#2714)
* Skip duplicate endpoint and close sampled paths in Sample Points node
Closes #2713

* Comment

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 19:00:28 -07:00
Keavon Chambers
eda858b6e2 Add support for the 'Boolean Operation' node to accept vector tables, not just groups 2025-06-19 18:58:19 -07:00
Keavon Chambers
96a0dada92 Replace 'Generate Handles' and 'Remove Handles' nodes with 'Auto-Tangents' node; rename vector2 data type to coordinate 2025-06-19 18:56:57 -07:00
Priyanshu
4696004dc9 Refactor the 'Spline' node to use Kurbo instead of Bezier-rs (#2701)
* copy and refactor spline algorithm from Bezier-rs

* add comments

* refactor spline node

* fix spline when path is closed

* use refactored version of spline algorithm

* revert changes to 'Spline' node funtion

* use manipulator groups instead of bezpath

* Fix comment

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 18:55:11 -07:00
seam0s
878f5d3bf7 Add overlays for free-floating anchors on hovered/selected vector layers (#2630)
* Add selection overlay for free-floating anchors

* Add hover overlay for free-floating anchors

* Refactor outline_free_floating anchor

* Add single-anchor click targets on VectorData

* Modify ClickTarget to adapt for Subpath and PointGroup

* Fix Rust formatting

* Remove debug statements

* Add point groups support in VectorDataTable::add_upstream_click_targets

* Improve overlay for free floating anchors

* Remove datatype for nodes_to_shift

* Fix formatting in select_tool.rs

* Lints

* Code review

* Remove references to point_group

* Refactor ManipulatorGroup for FreePoint in ClickTargetGroup

* Rename ClickTargetGroup to ClickTargetType

* Refactor outline_free_floating_anchors into outline

* Adapt TransformCage to disable dragging and rotating on a single anchor layer

* Fix hover on single points

* Fix comments

* Lints

* Code review pass

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 18:50:53 -07:00
Priyanshu
477a3f6670 Refactor the 'Morph' node to use Kurbo instead of Bezier-rs (#2696)
* fix morph node

* it worked!

* cleanup

* add comments

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 18:44:52 -07:00
Priyanshu
b0384adabc Refactor the 'Bounding Box' node to use Kurbo instead of Bezier-rs (#2662)
* use kurbo's default accuracy constant

* fix append_bezpath() method

* refactor bounding box node

* fix append bezpath implementation.

* comments

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 18:43:38 -07:00
James Lindsay
bf7caef6fb Instance tables refactor part 8: Output the type of the input data with the Mirror node as well (#2699)
* Flatten output of mirror node

* Enable reflection based on pivot, not just bounds

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 18:42:01 -07:00
James Lindsay
57bf2f873e Temporarily fix the Pen/Freehand/Spline tools by making vector modify apply to row 1 only (#2700) 2025-06-19 18:38:14 -07:00
Keavon Chambers
cea1a1c6a8 Instance tables refactor part 8: Make repeater nodes use pivot not bbox and output instance type not group; rename 'Flatten Vector Elements' to 'Flatten Path' and add 'Flatten Vector' (#2697)
Make repeater nodes use pivot not bbox and output instance type not group; rename 'Flatten Vector Elements' to 'Flatten Path' and add 'Flatten Vector'
2025-06-19 18:37:40 -07:00
Keavon Chambers
523cc27523 Improve the spreadsheet visualization details for VectorData 2025-06-19 18:37:39 -07:00
Keavon Chambers
6111440afd Instance tables refactor part 7: Remove RasterDataType and add Raster<CPU>/Raster<GPU> 2025-06-19 18:37:13 -07:00
Keavon Chambers
5cacab2e39 Instance tables refactor part 7: Rename "ImageFrame" -> "RasterData", "ImageFrameTable" -> "RasterDataType", and "RasterFrame" -> "RasterDataType" 2025-06-19 18:23:53 -07:00