Commit Graph

1218 Commits

Author SHA1 Message Date
Adam Gerhant e4ec67d852
Fix wires on document change and errors on hidden nodes (#2897)
* Fix wires on document change and errors on hidden nodes

* Code cleanup
2025-07-19 01:48:42 -07:00
Adesh Gupta 4427e97f73
Add "Make Path Editable" buttons in the Path tool control bar and Layer menu (#2900)
* Add graph message for adding a path

* Disable options when adding path tool is not possible

* Move Layer menu entry location

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-07-18 12:22:40 +00:00
Keavon Chambers 561b671f8d
Add transform-related nodes to improve transformation abilities (#2893)
* Improve transformation abilities with transform-related nodes

* Fix Transform -> Merge and Transform -> Artboard connections
2025-07-17 11:58:57 -07:00
Keavon Chambers 8f26c5c2ad
Remove the UVec2 and IVec2 graph data types and have Artboard use DVec2 (#2894) 2025-07-16 18:45:10 -07:00
Keavon Chambers 99966d848d Fix text per-glyph instance overlays and click target issues 2025-07-14 14:47:01 -07:00
Keavon Chambers 112efe88c2 Add multi-level loop indexing with the 'Instance Repeat' node 2025-07-14 02:55:44 -07:00
Keavon Chambers be8378309d Avoid crashing if an error occurs in the layout widget update handlers 2025-07-14 00:24:17 -07:00
Oliver Davies 74e35f026f
Fix regression with GRS cancellation being broken (#2877)
Fix for cancel regression in path tool
2025-07-13 22:03:51 -07:00
Salman Abuhaimed 166eb00c9c
Separate the Text node's generated glyphs into separate vector table rows (#2821)
* Separate glyphs into Vector data rows

* Fix `String Length` node

- Properly count characters with
`str.chars().count()` instead of bytes `str.len()`
- Change `String Length` node's output to `u32`

* Apply transform on instance instead of applying it when drawing the glyph

* Add checkbox to enable/disable per-glyph instances

* Tooltips

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-07-13 18:06:41 -07:00
Oliver Davies e89cded4b8
Add selection cycle and gray pre-selection outlines to the Path tool, and Tab to swap Select/Path tools (#2818)
* Added initial version of this feature for the path tool

* Removed debug statements

* Thickened the overlay width

* Added hover highlighting for path tool

* Experimental switch to path tool at leaf layer

* Ghost outline initial implementation

* Added tab swap for select tool -> path tool

* Minor fix for Select Tool dbl click -> Path Tool

* Added support for ghosts when using GRS in the path tool

* Fixed GRS undo bug, vastly improved hover behavior and now clearly visualize next double click target

* Fixed unused import warnings

* Updated behavior to handle mouse movement cases, reverted line width to 1px

* Fixed merge behavioral issues

* Disabled Select Tool to Path Tool double click toggle, fixed single click drill through for special case

* Clean up of unused consts and comment

* Properly cancel the drill through state when the mouse moves

* Fix some stuff

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-07-13 08:26:36 +00:00
Keavon Chambers 765092fbe9
Rename the message system's 'data' argument to 'context' (#2872) 2025-07-12 22:50:59 -07:00
Firestar99 4c75ddf936
Refactor node migration to be less susceptible to forgetting outdated strings (#2853)
* migration: make document migration use ProtoNodeIdentifier

* migration: NodeReplacement struct for better formatting

* migration: test for duplicates and fix them
2025-07-10 17:40:54 -07:00
Adesh Gupta 912e6f61a9
Fix regression with inability to drag segments using the Path tool's segment mode (#2850)
Fix segment dragging
2025-07-10 08:51:25 +00:00
James Lindsay 13ad814639
Add a complexity limit on displaying layer thumbnails to improve performance (#2828)
* Skip complex layer thumbnails

* Set Raster<GPU> to have usize::MAX render complexity

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-07-10 07:57:45 +00:00
Kavin e02510303e
Add X and Y offset distance overlay while dragging with the Select tool (#2814)
* Add offset overlay to select tool

* Add overlay to Dragging

* Add axis align behavior

* Style changes

* Add trim to string

* reduce code duplication

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-07-09 10:49:39 +00:00
mTvare a40de58c7c
Fix brush bounding boxes by making BrushCacheImpl's hash not shared between different instances (#2845)
* fix: add cache to each layer

* fix: warning

* fix: tests

* Clean up code

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-07-09 06:45:41 +00:00
Mohd Mohsin 00236c8136
Generate a visualization of the editor's hierarchical message system tree (#2499)
* Feat: implement the hierarchical tree for visualization

* rename HierarchicalTree trait function

* feat: change the HierarchicalTree from String to DebugMessageTree struct

* Nits

* feat: impliment proc macro to extract field from messagedata structs

* update the hierarchical-tree for hanlder data

* feat: added message handler struct to hierarchical tree

* feat: add the line number to message handler struct

* feat: added handler path to tree and NITS

* clean the white spaces in type string

* fixes some white spaces

* feat: added path to message enum in hierarchical tree

* feat: add file creation of hierarchical message system tree

* cleanup

* Code review

* Add todo comment for deferred change

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-07-08 19:13:51 -07:00
HWienhold d0e1d8982f
Allow tooling to treat near-zero-length handles as zero-length when converting to colinear (#2747)
fix colinear handles on connected path

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-07-08 18:47:56 -07:00
Keavon Chambers d2f8c99744 Avoid panics during document migration 2025-07-08 18:13:05 -07:00
mTvare 8a68683a93
Add pivot type selection with Custom Pivot, Origin (Average Point), and Origin (Active Object) to the Select tool (#2730)
* add origin

* cleanup pivot

* a lot of stuff

* reset pivot

* fix transform with pivot issues

* fixes

* some more cleanup

* fixes

* finally works

* origin fixes

* fix spaces

* fix using dragged_layers

* simplify pivot logic

* fix bugs

* fix the final bug

* fix in select_tool

* fix updates

* some more refactors to fix misunderstanding and refactor

* add checkboxes

* fix labels

* fix stuff which broke at merge

* update

* cargo fmt

* fix serde crash

* fix pivot not updating on move

* fix pivot not becoming last active refernce

* fix redraw issues

* add: active pivot

* cargo fmt

* fix pivot showing up in default mode

* add: pivot pin

* fix: use pin icons

* cargo: cargo lock update?

* fix: use checkbox instead of Overlays

* refactor: add dot to path_tool

* add: active origins

* UI tweaks

* add: add all of the stuff for path tool

* remove: unused layer

* fix: pivot pinning and origin angle

* fix: pin only if moved in first place

* cargo: fmt

* fix: pivot use disabled method

* fix: remove redudant NoOp

* fix: 3 stuff

* fix: select from elsewhere

* fix: compass rose wobbling around

* add: move pivot on grab

* add: move pivot on nudge

* add: move pivot on Grab

* Code review and tooltips

* fixes

* fixes

* fixes

* fix: skipping artboard on bounds calculation

* fix: by default have origin

* Fix prior fix

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-07-08 09:24:54 +00:00
Keavon Chambers a1d93da532 Fix 'Grid' node migrations breaking up-to-date documents 2025-07-07 18:39:04 -07:00
Firestar99 69ed80b79b
Add `::IDENTITY` to node macro to return a `ProtoNodeIdentifier` that is always a `&'static str` (#2842)
* fix warnings on master

* make the `ProtoNodeIdentifier` of a Node be accessible and always a borrowed `&'static str`

* always generate `node_name::identifier()`, even with `skip_impl`

* make `FrontendNodeType` use Cow

* remove broken `DocumentNodeDefinition`s for old GPU nodes

* don't reexport `graphic_element` in it's entirety, only data structures

* adjust everything to use the new `node_name::identifier()`

* fixup imports for wasm

* turn identifier fn into a constant
2025-07-07 16:29:59 -07:00
James Lindsay 4a83067081
Fix Path tool's Path node transform calculation by skipping local transform based on first instance source ID (#2843)
* First instance source id

* Set source node id and migrations
2025-07-07 22:09:21 +00:00
Adam Gerhant 24c6281644
Fix regression with migration code changed in node UI wire refactor (#2840)
Fixes
2025-07-06 14:34:43 -07:00
Adesh Gupta ce605acf3a
Make the Path tool's segment drag molding work with linear segments (#2838)
Fix path tool molding
2025-07-06 04:20:06 -07:00
Firestar99 2b380cec3a
Fix more node migrations that lost their implementations (#2836)
* fix migration for `SampleGradientNode`

* fix `BrushNode` unadjusted path

* fix `NoisePatternNode` unadjusted path
2025-07-06 02:00:07 -07:00
Adesh Gupta 8b0a27939e
Clean up the Path tool's FSM to move segment molding state into the dragging state (#2835)
Cleanup molding segments state
2025-07-06 00:39:47 -07:00
Adesh Gupta 49db963ce1
Improve Path tool layer selection behavior using double-click instead of single-click (#2794)
* Improve path tool layer selection behaviour

* Fix layer selection behaviour

* Fix layer double click selection behaviour

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-07-05 14:17:30 -07:00
Ezbaze 5b5b369dcd
Make selected Text category nodes show a multi-line text area instead of one-line text field (#2816)
* Make String Value node input a TextArea

Signed-off-by: ezbaze <68749104+Ezbaze@users.noreply.github.com>

* Replace link to Tauri

Signed-off-by: ezbaze <68749104+Ezbaze@users.noreply.github.com>

* Make String Concatenate node & Replace String node inputs into a TextArea

Signed-off-by: ezbaze <68749104+Ezbaze@users.noreply.github.com>

---------

Signed-off-by: ezbaze <68749104+Ezbaze@users.noreply.github.com>
2025-07-05 11:34:35 +00:00
Adam Gerhant f57163c795
Port node graph wires to the backend and improve graph UI performance (#2795)
* Improve node graph performance

* Fix wire bugs, add type default for properties.

* Grid aligned wire paths

* remove type source

* node from exposed input

* Refresh wires on preference change

* merge fixes

* Code review

* Fix names

* Code review

* Fix wires on redo/undo

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-07-04 22:53:37 -07:00
Keavon Chambers 354a68911e
Improve hotkeys with canonical flag, more industry-standard mappings, and fix GRS menu bar labels (#2827) 2025-07-04 04:58:52 -07:00
Firestar99 8a0241f0fa
Fix running tests locally; fix migrations for relocated nodes (#2805)
* fix `BoundingBox for Raster<GPU>` when `wgpu` feature is disabled

* fix `tinyvec` crate not being `std` by default

* fixup migration for `CoordinateValueNode`

* fixup migration for raster nodes
2025-07-04 02:56:22 -07:00
Firestar99 a182a7347e
Extract `gbrush` (#2784) 2025-07-01 18:38:47 +00:00
Firestar99 602d7e8bd1
Extract `graster-nodes` (#2783) 2025-07-01 18:12:12 +00:00
Keavon Chambers 8c5accc069
Clean up node catalog by adding missing units, more tooltips; fix 'Line' node missing parameters (#2813)
* Fix unit usages

* Add node and parameter doc comments

* Fix the parameters panel for the 'Line' node when added from the graph

* Clean up nodes

* Fix tests

* Update the demo artwork
2025-07-01 07:47:54 -07:00
Keavon Chambers 0febfaf142 Make the node graph unrenderable message less scary 2025-07-01 05:29:09 -07:00
Salman Abuhaimed 83773baa00
Replace Rustybuzz with Parley for text layout, and add text tilt parameter (#2739)
* replace rustybuzz with parley for text layout handling

change text input direction based on text direction

* Code review

* change default character spacing to 0

* add shear to text node

this also adds migration code for documents that don't have shear

* shear migration for text node

- add shear property
- set character spacing to 0

* use old max_width and max_height in text migration if available

* Final code review pass

* Add units to the parameters

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-07-01 02:23:17 -07:00
Dennis Kobert 0c376d1f9b
Disable preprocessor insertion of IntoNodes in the graph to avoid intermittent math node type errors (#2802)
Disable insertion of into nodes into the graph
2025-06-30 03:07:09 -07:00
0SlowPoke0 71ddae9028
Fix Path tool multi-point handle scaling behavior and double-click smooth/sharp conversion on rectangles (#2765)
* fixed double-click on anchor connected to linear segments

* fix when scaling when anchor

* Nit

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-30 07:56:22 +00:00
Firestar99 59e34836cd
Fix the 'Split Coordinate' node that was broken in an earlier refactor commit (#2787)
fix "Split Coordinate" node
2025-06-30 06:49:00 +00:00
Adesh Gupta 391ed34a30
Add segment editing mode to the Path tool (#2712)
* Segment select mode upto dragging

* Lasso select for segment editing

* Formatting

* Compatibility with point selection mode

* Add delete segment support and drawing from inside of shape

* Add GRS support for selected segments

* Cleanup and add dynamic hints

* Fix double click behaviour and overlays

* Format code

* Fix merge

* Fix Lint

* Fix formatting

* Fix lasso bug

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-29 23:19:54 -07:00
Hemu a4fbea9193
Fix lasso select extending the previous selection area after it was aborted (#2792)
Fix lasso select extends previous path after abort
2025-06-28 22:19:50 -07:00
James Lindsay cf8496b5a0
Fix Shape tool custom color picker using gamma not linear space (#2773)
Fix colour space for options
2025-06-27 18:32:14 -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 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 9cf8d2cd05
Run CI for non master branches (#2763)
* ci: run CI on PRs not targeting master

* fix warnings when compiling tests
2025-06-27 14:40:54 +02: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 c797877763
Fix regression in previous commit where node parameter updates didn't refresh the render (#2761)
fix changes in propeties panel not updating
2025-06-27 01:42:10 -07: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
Keavon Chambers 1a4d7aa23c Refactor the document upgrading code into a separate migrations file 2025-06-26 18:10:29 -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
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 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
Keavon Chambers ae88f4a3de Replace all hard-coded magic number node input indices with *Input::INDEX constants 2025-06-22 23:18:34 -07: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
Keavon Chambers dc0ae74cab Fix double-click event firing when dragging number input fields in Chromium 2025-06-22 03:11:57 -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
0SlowPoke0 8e5abf65cb
Add star/polygon gizmos and refactor the separate shape drawing tools into a unified Shape tool (#2683)
* no trait ,not to fix line

* add hints

* line modification even when other shapes are selected

* added transform and anchor overlays

* removed old code

* fixed transform added hints need to fix modifier keys use

* refactored select-tool

* add point-handle-gizmo

* fix rotate bug

* implement angle snapping gizmo , fix overlay and refactor the code

* implement snapping for point-handle gizmo and implement no of point gizmo need to refactor

* implemented the gizmo for polygon, added tests , brackets to increase sides

* formatting-fix

* small nit-picks

* Make it compile

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-22 00:53:49 -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 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 6b69a75391 Bulk rename `gcore` -> `gstd` in editor (#2729)
* remove `gcore` dependency from `editor`

* editor: bulk rename `gcore` -> `gstd`, cargo fmt
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 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
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
Adesh Gupta 579bedd9ff Fix editor crash when anchor sliding, followup to #2682 (#2726)
Fix editor crash due to unwrap
2025-06-19 19:11:13 -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
Timur Gainullin 8a3f133140 Fix undo bug returning to drawing a Pen tool rubber-band curve on prior parts of a previously drawn shape (#2710)
fix: add cleanup after pen path is closed

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 19:02:58 -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
Adesh Gupta f3720bf6f2 Add Pen tool support for starting and ending segment drawing on existing path edges for vector meshes (#2692)
* Start on segment

* Path tool ending on segment

* Overlays for feature

* Fixed merge build

* Fix overlays

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 19:01:07 -07:00
Adesh Gupta 781271782c 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>
2025-06-19 18:59:22 -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
Adesh Gupta f72263f4f8 Add molding segments to the Path tool (#2660)
* Moulding of cubic bezier

* Implemented falloff with interpolation

* remove conflict

* Move falloff to consts

* Spelling

* Refine falloff param and bug fix

* Code review

* Add colinear disable modes to molding degment feat

* Clean comments and unused code

* Code refactor

* Fix error

* Change colinear toggle behaviour

* Code review

* Remove KeyC feat + Fix overlay

* Dynamic hints in path tool

* Revamp molding logic

* Code review

* Remove unused Bezier algorithms (maybe useful for future reference)

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 18:55:57 -07:00
mTvare 4dfeafd65e Improve the click targets for the skew triangles of the transform cage (#2703)
Extend the bounding box over triangle to extend beyond the triangle
2025-06-19 18:54:13 -07:00
Adesh Gupta 33a31b4f17 Fix the Path tool's segment insertion line overlay having hysteresis with distance away from the cursor (#2677)
* Fix hysteresis in segment insertion

* Update editor/src/messages/tool/common_functionality/shape_editor.rs

* Update editor/src/messages/tool/common_functionality/shape_editor.rs

* Fix insert point overlay

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 18:53:14 -07:00
mTvare 04d7adb867 Fix grid overlay values getting wiped when switching between isometric/rectangular and back (#2702)
* Retain values present in previous git overlay state

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 18:51:56 -07:00
mTvare a1d85779ba Fix inability to deselect nodes, and nodes not being selected when pasted (#2691)
* Deselect on shift/alt click and paste selects multiple mode

* Grid values persistance

* reset

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-06-19 18:50:57 -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
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
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
Keavon Chambers 2696abc6b3
Replace Instances<T>::empty() with Instances<T>::default() and make it return an empty table for vector data instead of one empty row (#2689)
Make Instances<T>::default() return an empty table for everything, even vector, and replace ::empty() with ::default()
2025-06-04 21:00:21 -07:00
Keavon Chambers cb4289169d
Instance tables refactor part 6: unwrap VectorData and ImageFrame from single-row to multi-row tables (#2684)
* Start refactoring the boolean operations code

* Switch to iterators in the boolean operations code

* Make boolean operations work on rows of a table, not Vecs of single-row tables

* Remove more .transform()

* Simplify brush code

* Attempt to remove .transform() by using Instance<Image<Color>> in brush code, but a regression is introduced

* Improve blend_image_closure

* Simplify

* Remove leading underscore from type arguments

* Remove .transform() from ImageFrameTable<P> and fix Mask node behavior on stencils not fully overlapping its target image

* Remove more .one_instance_ref()

* Fully remove .one_instance_ref() and improve the 'Combine Channels' node robustness

* Fully remove .once_instance_mut()

* Fix tests

* Remove .one_empty_image()

* Make Instances<T>::default() return an empty table for images, but still not yet vector

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
2025-06-04 20:40:15 -07:00
Dennis Kobert 76ecdc8f1b
Fix the 'Upload Texture' node (#2680)
* Fix upload texture node

* Feature gate gpu node implemenations
2025-05-29 04:35:35 -07:00
mTvare 4d2e1d57fd
Instance table refactor part 6: remove usage of `one_instance_*` functions (#2672)
* Refactor the spline node

* Refactor the jitter_points node

* Refactor the morph node

* Refactor the merge_by_distance node

* Refactor the area node

* Refactor the centroid node

* Refactor the bevel node

* Refactor the tests

* Code review

* Refactor the morph node

* Refactor the extend_image_to_bounds and sample_image node

* Refactor the dehaze node

* Refactor the blur node

* Refactor the vector_points node

* Refactor the blit node

* Refactor the blend_gpu_image node

* Refactor the path_modify node

* Refactor the image_color_palette

* Fix copy_to_points

* Code review

* Partially make progress toward fixing the Draw Canvas node

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-05-29 03:08:16 -07:00
Adesh Gupta b564579362
Make the Path tool only allow selecting points that are visible (#2668)
* Fix only visible points selection in point selection

* Fix comments

* Remove bug from box selection and lasso

* Code review

* Fix comment

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-05-28 02:24:23 -07:00
0SlowPoke0 f6e592da5b
New nodes: 'Point Inside Shape' and 'Close Path' (#2673)
* add point inside shape,close path,and disabled node to layer conversion

* removed the usage one_instance

* code review
2025-05-26 02:15:31 -07:00
Adesh Gupta 3496e22f55
Fix box selection bug in the Path tool where document and viewport space got mixed up (#2671)
* Fix box selection bug

* Fix all layers selected on paste
2025-05-25 16:33:49 -07:00
0SlowPoke0 8a8e496058
Implement angle locking when Ctrl is pressed over an adjacent anchor (#2663)
* Implement angle lock from adjacent anchors

* Reset offset state and added comments

* Code review

* fix selecting correct handle to lock

* Update comment

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-05-24 12:09:43 +00:00
Keavon Chambers c4678336e5
Add support for clicking checkboxes via their labels (#2667) 2025-05-24 04:46:15 -07:00
Keavon Chambers 899ed5ad85 Tidy up the Layers panel with a new bottom bar 2025-05-21 04:14:01 -07:00
Mohamed Osama 66a297df2c
Improve the distribution part of the snapping system (#2626)
* fix distribution snapper visualization going far from layers

* fix bugs

* Remove traces

* remove comment

* Fix tests

* Rename distribution snapper variables from x, y to horizontal, vertical

* Fix tests

* Fix bug where center point and corner point have to be enabled for distribution_snapper to work

* Cleanup

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-05-20 00:15:56 -07:00
0SlowPoke0 ddb2d744d4
Make the Path tool support multi-point conversion between smooth/sharp on double-click (#2498)
* kinda works

* solved merge conflicts

* implement the multi flip

* nit-picks

* removed extra functions

* Fix inputs not being passed to backend for repeated double-clicks

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-05-19 22:11:38 -07:00