Commit Graph

1338 Commits

Author SHA1 Message Date
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
mTvare 9236bfcec0
Transfer pasted layers to the viewport center when outside the current view area (#2306)
* Transfer pasted layers to viewport center when not in viewport

Fixes #2301

* Move a layer as a whole and use change

* Make a bbox and move content according to that

* partial fix

* Only move if none within viewport

* Fix import error

* Fix artboard

* tmp, skip ones being added to ab

* fix stuff

* fix formatting

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-05-20 01:16:06 +00:00
mTvare 6c1ccfb5bb
Fix regression causing last selected layer to not be deselected (#2656)
Fix last selected layer not being deselected because .take() was placed inside if block
2025-05-19 16:58:03 -07:00
Keavon Chambers e57637aab1
Make builds of the editor and the website serve their own local fonts (#2186)
* WIP

* Done?

* Install fonts in CI

* Use absolute path so minified inlined CSS works

* Fix Bezier-rs demo fonts?

* Use opsz

* Revert removal of text balancer

* Pull in the text balancer from our static host
2025-05-19 02:38:29 -07:00
seam0s ea59f10b50
Fix editor crash due to mismanaged selected points on layers (#2640)
* Add hash sets to hold ignored points in SelectedLayerState

* Fix non selected anchor dragging

* Update selected points when ignoring handles or anchors

* Refactor selected points status logic

* Refactor ignore_handles and ignore_anchors bools to ShapeState

* Add back in ignore_anchors and ignore_handles in SelectedLayerState

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-05-18 21:09:58 +00:00
Sidharth-Singh10 2615d86934
Add PTZ support for flipping the canvas (#2394)
* feat: flip canvas

* move canvas_flipped from NavigationMessageHandler to PTZ

* fix artboard overlay flip

* Code review

* Improvements

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-05-18 06:16:00 +00:00
Keavon Chambers a8e209e44c
Remove the old node macro and fix/clean up several raster nodes (#2650)
* Fix several broken raster nodes and clean up leftover old node system code

* Migrate Brightness/Contrast to the new node macro, and fix it

* Remove last usages of old_node_fn

* Remove old_node_fn
2025-05-17 21:24:32 -07:00
Keavon Chambers 77f8bfd9ed Improve clarify of type errors and tooltip diagnostics 2025-05-17 16:13:05 -07:00
0SlowPoke0 6e7f218068
Add Path tool support for Ctrl-dragging to pull out zero-length handles with angle locking (#2620)
* implement check-drag and angle-lock

* track bool

* flip-smooth-sharp

* fixed bugs

* fixed flip-smooth jump bug and random angle locking bug

* ctrl-alt 90 case

* aligned flip-smooth sharp and fixed arbitrary handle-length when flipped

* code-review change

* 0.5 instead of 0.8

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-05-17 13:23:11 -07:00
Keavon Chambers d3b5dc5712
Clean up 'Image' node by removing old 'Cull' node in sub-network (#2643)
* Clean up 'Image' node by removing old 'Cull' node in sub-network

* Fix gamma correction on Decode Image node
2025-05-12 18:40:48 -07:00
mTvare c9984a8f1a
Make Select tool hover overlay in 'shallow select' mode visualize the next deeper object (#2639)
* Fix overlay behaviour on hovering over a layer

* Add the deepen overlay code

* cleanup
2025-05-11 07:53:38 -07:00
mTvare 4487020efb
Fix skew triangles showing up when transform cage isn't selected (#2638)
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-05-09 00:49:48 -07:00
Keavon Chambers a6ff221c1e Fix overlay clearing regression from #2521 with high-DPIs
Closes #2628
2025-05-08 16:48:49 -07:00
kythyria 9ef9b205d9
Auto-generate enum type widget boilerplate for radio buttons and dropdown menus (#2589)
* First draft of factoring out the dropdown boilerplate

* Add proc macro for enum boilerplate

* Detect whether to say `crate` or the name

* Clean up the input and naming of the enum macro

* Rename a file

* Do the rename of code too

* Use the attribute-driven selection of radio vs dropdown

* Add a metadata struct and tooltips

* Move the new traits to a better place.

* Use ChoiceType, part 1

* Use ChoiceType, part 2

* Introduce a builder API for choice widgets

* Start using the new new API

* DomainWarpType should be a dropdown still

* Handle the case where a node property can never have a socket

* Rustfmt

* Code review

* Update stable node IDs in test

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-05-01 04:14:26 -07:00
Sidharth-Singh10 2fc4896d01
Add tests for the Freehand tool (#2599)
* Add tests for freehand tool

* add test: line weight affects stroke width

* refactor
2025-04-30 19:53:59 +00:00
seam0s-dev 1a81e45673
Add the settings popover menu for the Overlays toggle (#2523)
* Added granular overlays control based on features

* Added basic support for pivot, path, anchors and handles overlay settings

* Added more overlay checks on anchors and handles

* Add new settings over measurements, hover and selection overlays

* Fix errors introduced while rebasing

* Disable anchors and handles functionality with their overlays, extended selection outline check

* Add check to enable/disable outlines on selected layers

* Toggle handles checkbox in sync with anchors checkbox

* Refactor overlays checks

* Remove debug statements

* Update select_tool.rs to resolve conflict

* Minor fix to reflect anchor checkbox state on the handles

* Minor fix to make anchors checkbox work

* Rearrange menu items, and code review

* Fix pivot dragging

* Add handles overlay check when drawing with pen tool

* Fix constrained dragging when transform cage is disabled

* Fix deselecting user selection when anchors are disabled

* Minor fix for disabling anchors

* Remove All from OverlaysType

* Remove debug statements

* Fix editor crash when selecting other layers with path tool and anchors disabled

* Minor fix on overlays check for all overlays

* Add proper code formatting

* Nits

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-30 04:15:46 -07:00
Adam Gerhant 1f7a9188ba
Improve the speed of SVG importing due to node positioning (#2625)
Fix slow svg import

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-30 03:38:09 -07:00
Mohamed Osama 0a65e570a9
Add snapping for a line's midpoint when it's being drawn (#2594)
* line midpoint snapper

* Add to snap option menu

* remove being_drawn_line_midpoint

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-30 05:12:04 +00:00
Boyu Dai 12896a2407
Fix node deletion being too greedy (#2619)
fix too greedy node deletion search

Co-authored-by: CaligulaAlucard <caligulaalucard@localhost.localdomain>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-30 04:22:17 +00:00
mTvare 90be1f42c6
Fix 'Shallow Select' mode behavior for selection context transference (#2604)
* Fix ancestor always returning None during shallow select

* Fixes

* fix shift remove on both

* cleanup

* one more cleanup

* final(?) fix

* some cleanup

* more stuff

* make shallow the default

* fixes

* fix

* fix

* fix

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-30 03:24:48 +00:00
Adesh Gupta da38f672ae
Insert point on segment by clicking once (no more sliding) and Alt+click to delete a segment (#2495)
* segment overlay change

* Segment split and delete

* Cleanup

* graceful handling of edge cases

* Moved constants to conts.rs and tuned the threshold

* Remove going into another state

* Insert point mode cleanup

* Linting fix

* Code review

* Added hints

* Added field for delete segment

* Change controls and fix too far logic

* Fixes

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-30 01:03:24 +00:00
Mohamed Osama 478ace3349
Fix a layer's transform being reset when it's reordered within its same parent (#2624)
Fix layer transform reset when being reordered within the same group/parent
2025-04-29 15:48:08 -07:00
Keavon Chambers 80b8df8d42 FIx the 'Morph' node to not fail on topology changes like holes 2025-04-29 04:49:08 -07:00
Sidharth-Singh10 0c3cae2ba5
Add Spline tool tests for drawing within a transformed artboard (#2575)
* Add Spline tool tests for drawing within a transformed artboard

* Refactor spline tool test to use click_tool and add draw_spline helper method

* refactor asserting point positions

* Fix decimal fomat

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-25 14:01:48 +00:00
Keavon Chambers d445bffe31 Add donation callouts in-app and on the site 2025-04-25 00:13:24 -07:00
Rahat 2dee47a6ee
Add Spline tool test for drawing with PTZ applied to the canvas view (#2573)
* Adding tests for spline PTZ

* Some refactoring

* Feedback applied from James

* Unnecessary changes

* refactor with current merged pr

* Code refactoring based on guidelines

* cli failing
2025-04-24 20:39:33 +01:00
Keavon Chambers 471ef87801 Add reference point input to the Mirror node 2025-04-24 05:33:20 -07:00
0SlowPoke0 d39308c048
Add Path tool feature for angle locking upon pressing Ctrl while dragging handle over anchor (#2612)
* almost_fixed

* fix need to refactor

* fixed issed need to refactor

* refactor-done fixed issue

* move function to common_functionality

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-23 20:39:14 -07:00
Mateo 3d37ef79ac
Add shape fill overlays when closing a path (Pen tool) or filling it (Fill tool) (#2521)
* Make the Pen tool show a path being closed by drawing a filled overlay when hovering the endpoint

* Add to_css to color.rs

* Check before unwrapping layer

* Close if in the right place

* Fix typo

* Format code

* Support discontinuous paths for closing preview

* Code review

* Denser fill lines

* Fill tool preview with strip lines only and revert pen shape-closing opacity

* Small adjustments to fill preview

* Fix line width of fill preview

* Use a pattern to preview the fill tool and fix canvas clearing

* Update pattern

* Simplify code

* Format code

* Use secondary color to preview fill if shift is pressed

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-23 18:33:08 -07:00
0SlowPoke0 a4a0e110d7
Improve Pen tool behavior to less aggressively delete single-point layers (#2605)
* add single-anchor-place

* clippy_changes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-23 11:45:51 +00:00
Keavon Chambers ac9fb2b02d
Improve instancing nodes (make them output group data, add 'Instance Repeat', fix Flatten Vector Elements click targets, and more) (#2610)
* Improve instancing nodes (make them output group data, add 'Instance Repeat', fix Flatten Vector Elements click targets, and more)

* Fix test?

* Fix more tests?

* Fix moar test??

* Clean up instance method naming
2025-04-22 17:55:57 -07:00
James Lindsay 704dad4f76
Fix angle logic in the Grid node to allow slanted isometric grids (#2602)
* Fix angles

* Fix hardcoded index

* More information on monitor nodes
2025-04-20 14:16:27 -07:00
Keavon Chambers a376832480
Fix and improve robustness of node/parameter tooltip plumbing; simplify properties row widget boilerplate (#2600)
* WIP

* WIP2

* Further cleanup
2025-04-19 20:25:36 -07:00
Sidharth-Singh10 6196dbff95
Add Gradient tool test for select and delete removes a stop (#2571)
* Add Gradient tool test for select and delete removes a stop

* refactor fills and double click into functions

* refactor
2025-04-19 16:00:59 -07:00
Rahat b45f7ef0c7
Add Line tool tests for drawing within a transformed artboard (#2572)
* Adding tests for artboard with transform

* Hypercube changes suggested
2025-04-19 17:44:27 +01:00
Rahat 1a5bef1d13
Add layer tree tests for moving layers with transform (#2585)
testing layer tree 5th checkpoint implementation
2025-04-19 00:43:17 -07:00
Sidharth-Singh10 73d12bcb82
Add tests for Spline tool to support continuing a previously drawn spline (#2591)
* Add tests for Spline tool to support continuing a previously drawn spline

* refactor
2025-04-18 22:24:35 +00:00
Rahat 0877c75959
Add layer tree tests for folder movement checking into child (#2580)
* testing parent child folder

* changes
2025-04-18 14:41:48 -07:00
ilya sheprut adfcff7599
New node: Arc (#2470)
* init

* add closed and slice options

* Make it work beyond -360 to 360 degrees

* Switch "closed" and "slice" to ArcType enum

* Update default ranges

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-18 09:42:07 +00:00
0SlowPoke0 33de539d6d
Fix Pen tool unable to combine multiple selected paths by extending their endpoints or mesh points (#2570)
* fixed issue

* merge-layers

* node-graph-autopanning-wire

* store the layer whne created instead of querying

* fix layers temporarily geting deselected while exteneding path

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-18 00:18:39 -07:00
mTvare 29e8e8bdac
Fix Shift-drag axis color inconsistency and pivot not being draggable with a zero-width bounding box (#2593)
* Fix axis colors not being consistent and pivot not being draggable with zero width boxes

Fixes #2311

* Even for path
2025-04-17 13:45:08 -07:00
Keavon Chambers 41fe46591a Update the parameter expose button in the Properties panel and fix undo history when it's clicked 2025-04-17 06:29:38 -07:00
Utsav Singh 7cb16a8bec
Fix Path tool behavior with Shift-dragging an already selected point, where it wrongly got deselected (#2395)
* Send path tool FSM to Dragging state on MouseDown if clicking selected point

* Cleanup

* Store selected point state before new selection is made and setup deselect logic

* update previously saved point data on every point selection

* Decide whether to deselect or select on extended_select if node not already selected,  when DragStop state is reached instead of inside the  mouse_down function.

* Fix broken merge and remove leftover debug statements

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-17 02:57:56 -07:00
Rahat bd1c0ff287
Add layer tree tests for folder self movement checking (#2579)
* Testing folder movement to self

* changes

* unnecessary code line removed
2025-04-17 08:17:43 +00:00
Keavon Chambers eca5d0d105
Add node description tooltips in the Properties panel and on secondary inputs in the graph (#2590)
Add tooltips to secondary inputs in graph/Properties panel, and to nodes in Properties panel
2025-04-17 00:59:46 -07:00
Adesh Gupta ab39f3f837
Add Path tool support for Alt-dragging an anchor to pull out a fresh equidistant handle pair (#2496)
* Added initial logic for dragging

* Alt drag stop makes opposite handle back to its position

* Implement new requested behaviour

* Fix sharp point bug

* Apply suggestions from code review

* Add hints

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-17 06:05:45 +00:00
Rahat c4484cb6cd
Add layer tree tests for layer arrangement (#2578)
* layer arrangement testing

* changes
2025-04-16 15:05:03 -07:00
Rahat bcab75f3c5
Add layer tree tests for layer selection (#2577)
* layer selection testing

* changes
2025-04-16 13:57:14 +00:00
Sidharth-Singh10 9acc23d0cc
Add Gradient tool test for dragging the stop rearranges the ordering (#2565) 2025-04-16 13:38:26 +00:00
Mohamed Osama af4f57ef38
Add "Perpendicular to Endpoint" snapping target (#2581)
* Perpendicular snap for line's endpoints

* move comment

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-16 12:23:45 +00:00
James Lindsay 435a6daf25
Add the first field-based nodes: 'Instance on Points', 'Instance Position', 'Instance Index', as well as 'Grid' (#2574)
* Basic fields

* Add 'Extract XY' and 'Split Vector2' nodes

* Add 'Instance Index' node

* Fix test again

* Improve grid generator to support rectangular as well

* Avoid crashing

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-16 11:58:59 +00:00
Keavon Chambers 184c009f17 Add memoization to instancer nodes 2025-04-16 04:43:47 -07:00
Adam Gerhant ee6a842a6b
Fix dragging a node onto a secondary input's wire not working (#2583)
Fix dragging onto wire
2025-04-16 01:52:15 -07:00
Sidharth-Singh10 98558c74f4
Add Gradient tool test for dragging an endpoint setting the correct point in the viewport (#2564)
* Add Gradient tool test for dragging an endpoint sets the correct point in the viewport

* add canvas_zoom and transformset to verify correct viewport-space behavior
2025-04-14 19:25:07 +00:00
Dennis Kobert 9b23c7e2db
Update Tauri to v2 and execute only the node graph in native (#2362)
* Migrate tauri app to v2

* Move flake files to sub directory

* Remove unused plugins

* Backport some of the tauri code

* Implement async node graph execution

Only move node runtime to native code

* Always use gpu feature for tauri

* Fix serialization

* Add logging filters

* Enable native window rendering with vello

* Cleanup

* Remove unused editor instance

* Remove changes from vite config

* Remove warnings

* Remove unused files

* Fix most tests

* Cleanup

* Apply frontend lint

* Readd flake.nix

* Fix tests using --all-features

* Code review

* Enable all backends

* Fix monitor node downcast types

* Change debug log to a warning

* Disable shader passthrough

* Cleanup unused imports

* Remove warning

* Update project setup instructions

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-14 11:43:15 +00:00
0SlowPoke0 d194c784be
Prevent auto-panning in Pen/Spline tools while drawing without dragging (#2463)
don't autopann when mouse up

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-13 18:21:59 -07:00
Mateo c2a36ce981
Restore auto-panning that #2443 had broken (#2562)
* Fix auto panning

* Clean up comments

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-13 22:19:08 +00:00
Rahat b3d6be9618
Add tests for Line tool with PTZ (#2559)
* cli failing

* cli failing

* Adding tests for line tool with zoom pann and tilt
2025-04-13 20:13:59 +00:00
Mateo 6bc12c8ede
Invalidate cache when unexposing input (#2512) 2025-04-13 19:33:37 +00:00
Rahat 272a5ce0df
Add GRS tests for different types of nested layer multi-selections (#2518)
* cli failing

* cli failing

* test_transform_with_different_selections and groups

* merge conflict

* Use abs_diff_eq in assertions

* Added test 4

* Added test 4

* removed unnecessary changes
2025-04-13 20:06:11 +01:00
mTvare 3e6021fb8f
Fix inability to drag axis-aligned lines (#2561)
* Fix 1 and 3

* Fix 2

* Shape tools refactor

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-13 03:51:40 -07:00
Ellen Gu fdff5d4e5e
Disallow the Gradient tool from applying to raster images (#2456)
* fix gradient on raster graph error

* Remove should panic from gradient ignore raster tag

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-12 18:42:59 -07:00
Adesh Gupta 550ffc3f7f
Fix box selection erroneously including zero-length handles; fix GRS failing on sharp points (#2550)
* Fixed box selection selecting zero length handles

* Fix GRS for sharp points

* Apply suggestions from code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-13 01:21:36 +00:00
Keavon Chambers e759e62291 Comment out all remaining active Imaginate code 2025-04-12 17:32:24 -07:00
Keavon Chambers a11f9b36c3 Add the menu bar command: Help > Debug > Reset Node Definitions on Open 2025-04-12 16:56:55 -07:00
Keavon Chambers 100df9a81d Remove 'Memoize Impure' from document node definitions 2025-04-12 05:15:05 -07:00
Keavon Chambers a8a5a1f3fd New node: Sample Gradient 2025-04-12 04:19:46 -07:00
0SlowPoke0 c156c0a4ce
Improve Pen tool segment drawing confirm/cancel behavior (#2555)
* implement enter to end path

* fixed_abort

* added_hints

* edge-case

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-12 09:50:35 +00:00
Keavon Chambers 69069ef723
Fix the 'Repeat', 'Circular Repeat', and 'Mirror' nodes to work on point cloud vector data (#2553)
* Include points in bounding box calculations

* Fix unrelated crash from debug assert when reordering root-level folders

* Fix another unrelated crash from debug assert when GRS scaling to size 0

* Fix several vector nodes to respect and propagate local transform space
2025-04-12 02:18:31 -07:00
Sidharth-Singh10 e4d998a400
Add test for double clicking to insert a gradient stop (#2527)
gradient tool test: Double click to insert a gradient stop

Co-authored-by: James Lindsay <78500760+0HyperCube@users.noreply.github.com>
2025-04-11 14:26:07 +00:00
Keavon Chambers 0d10ad2161 Revert double-click to open node catalog from #2423 because it occurs even outside the graph 2025-04-10 14:55:35 -07:00
Utsav Singh 93f7004ece
Make the node catalog, originating from a wire dropped in the graph, filter for valid types (#2423)
* Add InputType based filtering capabilites to NodeCatalog.
Send InputTypes through SendUiMetadata under
odeTypes.
Update NodeCatalog.svelte component to support 	ype based filtering.
Update ContextMenuData to support compatibleType as an input to the searchTerm for the NodeCatalog.
Update Graph.svelte component to support new ContextMenuData enum types.
Send CompatibleType data from rust backend on wire drag and release to NodeCatalog to already show filtered data.

* Add InputType based filtering capabilites to NodeCatalog.
Send InputTypes through SendUiMetadata under
odeTypes.
Update NodeCatalog.svelte component to support 	ype based filtering.
Update ContextMenuData to support compatibleType as an input to the searchTerm for the NodeCatalog.
Update Graph.svelte component to support new ContextMenuData enum types.
Send CompatibleType data from rust backend on wire drag and release to NodeCatalog to already show filtered data.

* Open NodeCatalog on DoubleClick in empty node graph area

* Capture Node implementations and filter out uncatogrised nodes before sending metadata.
Update NodeCatalog Search filter to support single type search alongside name and category search

* Take union of DocumentNodeTypes and registered node implementations, Update missing categories and make sure to remove nodes with empty categories

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-09 01:07:35 -07:00
Adesh Gupta 8b0f16e74c
Make GRS rotation (R) angle overlay label show values between -360° and 360° (#2473)
* Fixes issues

* Revert changes

* Viewing angle using R

* Revert other fix so it can be its own PR

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-09 06:15:31 +00:00
Sidharth-Singh10 b38d725d98
Add input hints to interactions in the node graph (#2415)
* node_graph: add hints in status bar

* allow in-progress interactions

* Fix node graph hints not restoring after panning operation

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-09 05:50:48 +00:00
Sidharth-Singh10 3c1ec45188
Add option to adjust viewport zoom rate in the preferences dialog (#2420)
* zoom rate preference

* Add generic range mapping functions for improved reusability

* cleanup

* Map zoom slider's default value of 50 to the original zoom rate (0.005)

* use . instead of .0 for whole-number floats

* Refactor zoom rate mapping to use a fixed reference point and adjustable curve steepness

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-08 07:51:46 +00:00
0SlowPoke0 6a8386d1e9
Improve Pen tool handle dragging with Tab swapping, Ctrl angle locking, and directly dragging the closing endpoint in handle (#2452)
* added handle_types and refactored the handle_adjustments

* anchor move refactor

* code-todo-fix

* removed-draw-mode

* kind of works need to figure out snapping

* some refactoring

* refactor+overlays..need to fix the snapping and dragging

* added docs

* got stuck in space move

* fixed all issues

* comments and small fixes

* completed last issue and refactor

* major fixes and improv

* fixed edge cases

* edge cases fixed

* fix edge cases and add docs

* Code review pass

* rename ,bug fixes

* Add terminology diagram

* Add Ctrl "Lock Angle" hint

* Rename other hint

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-07 23:26:51 -07:00
Ellen Gu 32aee1ebf9
Add Vello support for Outline view mode rendering; add non_scaling to strokes (SVG, not yet Vello) (#2455)
* fix noise pattern parameter issue

* removed the commented out line

* Fix outline mode stroke width not consistent

* add non scaling stroke option

* Fix backward compatibility

* Clean Debug Message

* clean code

* clean code 2

* Add vello outline support

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-07 00:02:11 +00:00
Sidharth-Singh10 3c425d9a71
Fix Gradient tool always re-selecting its end point after any click/drag (#2472)
fix  gradient tool incorrectly selecting end point on pointer up

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-06 15:14:19 -07:00
Utsav Singh 56fafa942a
Fix the 'Mask' node from always erroring (#2474)
Fix mask node upstream input calculation.

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-06 14:33:25 -07:00
Rahat 1001ec2740
Add test for scaling objects to zero without any crash (#2491)
* Add test for scaling objects to zero

* added non zero scale after near zero scale to check if everything is working ifine

* unnecessary change

* cli failing

* chore: upgrade openssl to fix RUSTSEC-2025-0022

* cli failing

* new changes
2025-04-06 14:42:15 +01:00
James Lindsay e11b57a7af
Add tests for gradient drawing with transformations (#2481)
* Test gradient drawing with transformations

* Fix bad import

* Fix merge conflicts

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-06 10:35:20 +00:00
mTvare f003d5d0db
Fix Line/Spline tools being offset when drawing in an artboard not at the origin (#2489)
* Fix line overlays not showing up for horizontal/vertical line

* Fix spline tool transform

* Fix line tool transform

* Fix pivot following mouse even after confirm

* cargo fmt

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-06 03:06:03 -07:00
0SlowPoke0 2f22ce500c
Fix a bug in #2419 (Add recursive folder expand/collapse to the Layers panel) (#2494)
recursive-collapse-fix and clippy-fix

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-06 02:44:10 -07:00
Oliver Davies 81db769737
Minor fixes for 'Round Corners' and 'Mirror' nodes (#2510)
* Fix round corners node not properly maintaing click targets, added keep_original bool to mirror node

* Fixed fix for the theta angle

* Add upgrade script for Mirror node

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-04-06 02:00:55 -07:00
Mateo a6d3c06641
Fix bug introduced in #2511 (#2513)
Fix issue when extending existing paths

Co-authored-by: Starklosch <45690579+Starklosch@users.noreply.github.com>
2025-04-04 22:23:26 -07:00
Mateo c486c6e3e3
Fix Pen tool creates single anchor path (#2511)
* Delete layer if path has a single anchor

* Remove unnecessary layer reference from pen state
2025-04-03 19:41:51 +00:00
Rahat 6de235f80c
Test that select tool GRS works with only one anchor (#2502)
* one-anchor-point-testing implementation

* merge conflict

* merge conflict

* ci cd error
2025-04-02 21:31:29 +01:00
prathmesh703 fb17b9389c
Add tests for drawing lines with ctrl, shift, and alt (#2490)
* test_tool_line

* Test-line-tool

* ALT-test-case

* formatted

---------

Co-authored-by: doxe-2611 <kolpe2611@gmail.com>
2025-04-02 17:48:13 +00:00
Dennis Kobert 8d8e2edc5f
Add 'Freeze Real Time' and 'Boundless Footprint' nodes as alternatives to using 'Memoize Impure' (#2509)
* WIP debugging

* Only create parent ref if var args are used in context + Cleanup

* Eval nodes with None instead of relying on MemoImpure

* Remove unused imports

* Show parent in debug output

* Remove TODO comment
2025-04-02 11:31:52 +00:00
Keavon Chambers cdf896bf79 New demo artwork: "Parametric Dunescape" 2025-04-01 23:20:34 -07:00
Rahat c4e16e1aac Add tests for document panning, zooming, and rotating (#2492)
* add tests for panned, zoomed, and rotated

* add tests for panned, zoomed, and rotated

* Did some changes for grs system

* change
2025-03-31 12:28:47 -07:00
Rahat a1ce796d94
Add test for chained GRS transformations (#2475)
* added tests for chained tasks

* added tests for chained tasks, applied the feedback from 0hypercube

* some changes in grs chained test to make it more robust

* unnecessary changes
2025-03-29 20:21:40 +00:00
Dennis Kobert 41288d7642
Fix the Into nodes, which were broken but unused except in GPU nodes (#2480)
* Prototype document network level into node insertion

* Fix generic type resolution

* Cleanup

* Remove network nesting
2025-03-27 02:11:11 -07:00
Rahat dd27f4653d
Add tests for GRS transform cancellation (#2467)
* tests for GRS transform cancellation

* Added all the tests with not cancelling and cancelling both

* remove unnecessary code from gitignore
2025-03-23 18:40:26 +00:00
Keavon Chambers 4e418bbfe1 Fix device pixel ratio being tied to the document by moving it from overlays to portfolio 2025-03-21 10:13:08 -07:00
Dennis Kobert 5f398e79e9
Improve animation handler state management (#2471) 2025-03-19 11:15:22 -07:00
Keavon Chambers 08a4b69948 Add animation control buttons to document bar 2025-03-19 02:15:40 -07:00
Dennis Kobert 44694ff8d6
Experimental animation support (#2443)
* Implement experimental time routing to the node graph

* Allow toggling live preview with SHIFT + SPACE

* Add animation message handler

* Fix hotkeys

* Fix milisecond node

* Adevertize set frame index action

* Fix frame index

* Fix year calculation

* Add comment for why month and day are not exposed

* Combine animation nodes and fix animation time implementation

* Fix animation time interaction with playback

* Add set animation time mode message

* Captalize UTC

* Fix compiling

* Fix crash and add text nodes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-19 01:19:49 -07:00
mTvare b98711dbdb
Improve Text tool resize/drag behavior (#2428)
* Have red be below quads

* Code review pt 1

* Skip rendering of pivot

* Code review pt 2

* Code review pt 3

* Cancel resize and its hints

* Remove the redundant placing message

* Dragging state for text tool fsm

* Cleanup

* Fix line tool undo and abort problems

* Code review

* 3px textbox overflow bottom

* Some more cleanup

* Fix reversed match arms that had been converted to if-else

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-19 06:49:49 +00:00
James Lindsay 43275b7a1e
Add the Spreadsheet panel to inspect node output data (#2442)
* Inspect node ouput stub

* Fix compile error in tests

* Create a table

* Clickable tables

* Add vector data support

* Checkbox to enable the panel

* Remove Instances table ID column; style the spreadsheet

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-18 23:06:05 -07:00
Keavon Chambers 6292dea103
Refactor many usages of Color to natively store linear not gamma (#2457) 2025-03-18 05:37:20 -07:00
Adesh Gupta 4275eaf5bf
Add Path tool support for dragging along an axis when Shift is held (#2449)
* Initial logic for snapping

* Solved switching of axes

* Solved conflict

* Fixed autopanning issue

* Autopanning issue

* cleared comments

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-18 07:57:48 +00:00
mTvare 7e7e88f6fa
Refactor GRS messages and fix regression in chained GRS operations (#2450)
* Refactor GRS messages and have a switch handler

* some cleanup

* rename variables

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-17 11:50:11 +00:00
Priyanshu b4006479d1
Fix Pen tool so it cancels (not confirms) a handle drag in which setting colinearity moves the other handle (#2439)
fix aborting executing a command in the pen tool

Co-authored-by: indierusty <priyaayadav@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-17 10:38:11 +00:00
James Lindsay cabc027cda
Fix Select tool resizing with Shift held allowing the constrained aspect ratio to change when snapping (#2441)
Fix bug in constrained snap
2025-03-17 03:18:05 -07:00
0SlowPoke0 bd97c15da8
Make the Select tool box-select the deepest individual layers or their common shared parent (#2424)
* fixed deep-select and overlays

* minor fix

* made minor fixes in filtering

* small fix

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-15 12:42:42 +00:00
James Lindsay ca5810c92a
Fix drawing tools to work in viewport space instead of document space (#2438)
* Stroke width in viewports

* Update rectangle tests
2025-03-15 04:22:50 -07:00
James Lindsay 5cdcc37379
Make the Transform node's skew parameter input actually in degrees (#2431)
* Make skew actually in degrees

* Add min and max

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-14 11:27:18 +00:00
mTvare 39894b3b78
Fix constrained snap when dragging by a compass rose axis and fix that axis line's jiggling (#2333)
* Fixes constrained snap when using compass axes; Fix line banding

Fixes #2313
Fixes line banding[0]

[0]: https://discord.com/channels/731730685944922173/931942323644928040/1345339390809083934

* Separate axis align and axis constraint logic

* Final fix

* Use projection instead of length

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-13 00:58:16 -07:00
Dennis Kobert beb1c6ae64
Upgrade to the Rust 2024 edition (#2367)
* Update to rust 2024 edition

* Fixes

* Clean up imports

* Cargo fmt again

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-12 17:29:12 -07:00
Utsav Singh 927d7dd9b2
Fix quick measuring of skewed and rotated layers by using the viewport space AABB (#2396)
* Make sure that quick measure overlays are based on AABBs drawn in the viewport local space

* Draw overlays to visualise AABBs of selected and hovered shapes

* use pre-existing functions to render dashed lines

* Redraw selected bounds using existing BoundingBoxManager

* remove unused variables

* Render transform cage after overlay is drawn

* Bring overlay and transform cage render calls above(before) other  gizmos

* Add line length tolerance and render single line for singal edge alignment with one axis overlap

* Comments

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-12 10:53:58 +00:00
0SlowPoke0 2bcfe5ea0c
In the Pen tool, make Space drag the whole manipulator group while dragging a handle (#2416)
* implemented space drag need to handle unwrap + clean snap cache

* completed the space drag need to refactor

* refactor

* small comment changes

* formating_fix

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-12 03:27:35 -07:00
Nitish Choudhary c0d3eb8072
Add sizing gizmos to the Text tool's text area (#2176)
* Fix abortion while dragging

* Create function for text bounding box

* Reorder arms of text tool FSM

* add transform cage to textbox pt.1

* add transform cage pt.2

* Fix minor issue after merge

* Get bounding box working in place without action keys

* Add max_height and disable pivot drag

* Cleanup code and write doco for new utility function

* Minor change due to merge

* Add bottom overlay

* Get modifier keys to work pt.1

* Code cleanup

* cleanup

* Fix transform

* Minor improvements

* Undo debug statement!

* Add comments and keep original layer transformation

* Alt from centre

* Fix merge conflict

* Minor code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: James Lindsay <78500760+0HyperCube@users.noreply.github.com>
2025-03-12 10:07:10 +00:00
Keavon Chambers a696aae044
Instance tables refactor part 5: unwrap GraphicGroup as multi-row Instance<GraphicElement> tables and move up transforms (#2363)
* Just group

* Partly working but without transforms

* Remove Transform/TransformMut from GraphicElement and GraphicGroupTable

* Fix layers and flattening

* Fix transform group handling on the remaining nodes

* Change collect metadata

* Add transform on vector data. TODO: Remove duplicate transform

* Small code tidying-up

* Add concatenate node?

* Remove ignore_modifications which is always false

* Improve transforms

* Mostly fix the nested transform cage angle (except leaf layers and skew)

* WIP attempt to integrate skew

* Fix nesting bounding box

* Avoid setting the transform

* Fix stroke transforms

* Renderer cleanup

* Fix tests for repeated elements not given unique point IDs

* Suppress cargo-deny warning

* Fix upgrade code for graphic group data

* Work around rendering issue in Isometric Fountain

---------

Co-authored-by: Adam <adamgerhant@gmail.com>
Co-authored-by: hypercube <0hypercube@gmail.com>
2025-03-12 01:38:36 -07:00
0SlowPoke0 d2fc919ba6
Add recursive folder expand/collapse to the Layers panel (#2419)
* added_recursion_fix

* Add tooltip and tidy up color visibility

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-10 21:01:00 +00:00
Ellen Gu 74b6abbb97
Fix fill tool on raster image temporarily breaking the graph (#2398)
* Fix fill tool on raster image temporarily breaks the graph

* Avoid vector filling raster layer via checking node category

* check raster image using input type instead

* Add additional check for TextureFrameTable

* Enable the ignore raster test

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
2025-03-09 19:18:42 +00:00
Ellen Gu 56662339cc
Fix noise pattern parameter issue (#2412)
* fix noise pattern parameter issue

* removed the commented out line
2025-03-09 11:09:20 +00:00
Priyanshu 0a91dd2141
Disable the Path tool's "Colinear Handles" checkbox when no interior anchors are selected (#2339)
* disable "Colinear Handles" checkbox when only endpoint or its handle is selected

* small refactor

* ignore endpoints when calculating multiple selected points colinearity

---------

Co-authored-by: indierusty <priyaayadav@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-07 21:50:52 -08:00
Keavon Chambers 381dcbf17f
Update dependencies throughout the project (#2401)
* Update dependencies

* Update stable node ID hashes again, for some reason?
2025-03-07 21:32:52 -08:00
Keavon Chambers c4cf47703a
Tidy up NodeNetworkInterface, replacing &[] root network arguments with methods for the document network (#2393)
* Replace `.selected_nodes(&[])` with `.selected_nodes_in_nested_network()` and `.selected_nodes()`

* Replace `.network(&[])` with `.document_network()` and `.nested_network()`

* Replace `.network_metadata(&[])` with `.document_network_metadata()`
2025-03-07 01:33:24 -08:00
Keavon Chambers 22a900b35e Fix regresion from #2265 causing an extra default artboard to show up 2025-03-06 22:56:09 -08:00
James Lindsay b171eeba84
Add tests to the Ellipse, Artboard, and Fill tools (#2181)
* Add ellipse tests

* Add tests for fill tool and re-enable some other tests

* Code review

* Fix Rust crate advisory

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-07 02:13:15 +00:00
Dennis Kobert 1190e82322
Fix document upgrades to work recursively within subgraph nodes (#2369)
* Apply updates to the call argument recursively to subnetworks

* Fetch recursive metadata

* Apply replacements recursively
2025-03-06 15:42:58 +00:00
Keavon Chambers 19a140682e Instance tables refactor part 4: replace ArtboardGroups with multi-row Instances<Artboard> (#2265)
* Clean up dyn_any usages

* Migrate ArtboardGroup to ArtboardGroupTable (not yet flattened)

* Reorder graphical data imports

* Flatten and remove ArtboardGroup in favor of ArtboardGroupTable

* Fix test
2025-03-06 05:36:26 -08:00
Keavon Chambers 2f6c6e28f0 Instance tables refactor part 3: flatten ImageFrame<P> in lieu of Image<P> (#2256)
* Remove ImageFrame<T> by flattening it into Image<T>

* Rename TextureFrame to ImageTexture

* Fix tests
2025-03-06 05:36:17 -08:00
Keavon Chambers f1160e1ca6 Instance tables refactor part 2: move the transform and alpha_blending fields up a level (#2249)
* Fix domain data structure field plural naming

* Rename method one_item to one_instance

Rename method one_item to one_instance

* Move the Instance<T> methods over to providing an Instance<T>/InstanceMut<T>

Move the Instance<T> methods over to providing an Instance<T>/InstanceMut<T>

* Add transform and alpha_blending fields to Instances<T>

* Finish the refactor (Brush tool is broken though)

* Add test for brush node

* Fix brush node

* Fix default empty images being 1x1 instead of 0x0 as they should be

* Fix tests

* Fix path transform

* Add correct upgrading to move the transform/blending up a level

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
2025-03-06 05:36:09 -08:00
Dennis Kobert 4ff2bdb04f Replace Footprint/() call arguments with dynamically-bound Contexts (#2232)
* Implement experimental Context struct and traits

* Add Ctx super trait

* Checkpoint

* Return Any instead of DynAny

* Fix send implementation for inputs with lifetimes

* Port more nodes

* Uncomment nodes

* Port more nodes

* Port vector nodes

* Partial progress (the stuff I'm more sure about)

* Partial progress (the stuff that's not compiling and I'm not sure about)

* Fix more errors

* First pass of fixing errors introduced by rebase

* Port wasm application io

* Fix brush node types

* Add type annotation

* Fix warnings and wasm compilation

* Change types for Document Node definitions

* Improve debugging for footprint not found errors

* Forward context in append artboard node

* Fix thumbnails

* Fix loading most demo artwork

* Wrap output type of all nodes in future

* Encode futures as part of the type

* Fix document node definitions for future types

* Remove Clippy warnings

* Fix more things

* Fix opening demo art with manual composition upgrading

* Set correct type for manual composition

* Fix brush

* Fix tests

* Update docs for deps

* Fix up some node signature issues

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: hypercube <0hypercube@gmail.com>
2025-03-06 05:35:56 -08:00
mTvare 0c1e96b9c6
Fix chaining GRS commands so they work smoothly and don't add intermediate undo steps (#2297)
Fix GRS chaining behaviour and generalise Abort to have n≠1 undos

Fixes https://discord.com/channels/731730685944922173/881073965047636018/1328281947918696458
2025-03-06 13:16:19 +00:00
Nitish Choudhary 8f7dd2021d
Allow the Line tool to drag start and end points of line layers (#2278)
* Initial attempt

* Allow editing and display overlays

* Fix modifier keys

* Handles show up correctly when layer is transformed

* Add multi-layer editing support and cleanup

* Fix transform breaking the handles

* line between handles

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-06 12:39:56 +00:00
Priyanshu 27cf1682bc
Fix Pen tool click-dragging from handle causing opposite colinear handle to rotate with drag (#2338)
fix pen tool rotating the handle of the endpoint we are extending

Co-authored-by: indierusty <priyaayadav@gmail.com>
2025-03-06 12:14:03 +00:00
mTvare e9ecdc7e01
Enable free movement of transform cage edge during skew when Ctrl is held (#2358)
* Enable free movement of edge during skew when ctrl is held

Fixes #2299
Follow-up to #2300

* Simplify code

* Change test along the lines of new behaviour

* Make the hint Title Case

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-06 11:57:02 +00:00
Dennis Kobert e7cde88c04
Fix perf regression from updating the hints bar every frame (#2360)
* Store has_dragged in tool state

* Revert tool_data inclusion in update hints method
2025-03-06 00:23:47 -08:00
Keavon Chambers ddb0c8c249 Reorganize the menu bar and add additional commands to it 2025-03-01 13:44:28 -08:00
Dennis Kobert fd81d043a2
Fix wrong node parameter widgets, attempt 3 at #2323 (#2334)
* WIP, for TrueDoctor to continue

* Expose first implementation type as default type in field metadata

* Cleanup

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-01 13:26:21 -08:00
Keavon Chambers e41471c088 Fix wrong node parameter widgets, attempt 2 at #2323 2025-03-01 04:34:12 -08:00
mTvare 1510ad820c
Add draggable skew triangles to the transform cage (#2300)
* Add triangle handles to transform cage for skew transform

Fixes #2299

* Add skew triangles

* Fix conflicts which github didn't show

* cargo fmt

* Fix needed

* remove unreachable

* use the trap and rect logic

* fix quad checks

* cursor fix; no triangles if already dragging and not skewing

* cargo fmt

* Resolve Clippy lints

* Add min length for triangle visibility

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-01 10:24:56 +00:00
mTvare 37b4e3d410
Make it easier to resize short/narrow edges of the transform cage without corners taking precedence (#2320)
* Add threshold beyond which the corner point is valid

Fixes https://discord.com/channels/731730685944922173/931942323644928040/1344594798404964364

* Add missing delimeters

* Code review

* Widen the constant

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-01 08:39:47 +00:00
0SlowPoke0 1b59a9414a
Fix several minor Pen and Path tool bugs (#2327)
* code-todo-fixes

* small typo

* fixed bent_case when drawn from start point

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-01 08:14:29 +00:00
Adesh Gupta 3a7d1938b6
Make Ctrl+D duplication interleave each layer like Alt+drag duplication already does (#2328)
Fixed order of layers on Ctrl D

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-28 23:44:13 -08:00
Priyanshu 778f589918
Add a workaround to prevent nudge resizing from giving lines a NaN scale (#2331)
* fix nudging the transform of 0 scaled object to `Nan` value by avoid division by zero vec2

* Update editor/src/messages/portfolio/document/document_message_handler.rs

---------

Co-authored-by: indierusty <priyaayadav@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-01 07:18:01 +00:00
prathmesh703 17215ea66f
Add the Select Parent command (#2329)
* Select-Parent-Layer-Button

* check fail fixed

* check fail

* Add hotkey, fix top-level layers getting deselected, code review

---------

Co-authored-by: doxe-2611 <kolpe2611@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-01 03:43:24 +00:00
Adesh Gupta b6cdcba9e8
Fix duplicates not all being selected after Ctrl+D (#2324)
Fixed selecting all duplicates on Ctrl+D

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-27 22:29:26 -08:00
Oliver Davies effadcf6a6
Add feature for switching existing boolean ops to another type in the Select tool (#2322)
* Add feature for toggling an existing boolean to another type in Select tool

* Code simplifications and comments

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-28 05:39:21 +00:00
Adam Gerhant cbb535b6b5
Fix incorrect Properties panel widget types for proto nodes (#2323)
Fix incorrect property types for protonodes
2025-02-27 21:22:02 -08:00
Priyanshu c3b01605c4
Fix Spline tool so its merging endpoints with other layers happens immediately, not after canceling (#2319)
merge endpoints on point insert

Co-authored-by: indierusty <priyaayadav@gmail.com>
2025-02-27 02:53:55 -08:00
Priyanshu 674db97dc4
Implement merging pairs of {paths, splines} with the Pen and Spline tools (#2292)
* refactor

* impl find_spline function

* impl merge_layers() to merge two spline layer to one spline layer

* impl merging spline to another spline which are not in the same layer

* impl merging of spline with path

* impl merge spline start endpoint and last endpoint

* fix naming

* fix handle transformation

* refactor

* fix merging with path with only one segment

* refactor

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-21 17:43:49 -08:00
Keavon Chambers fb13d58767 Declare the start of the Alpha 4 release series 2025-02-21 13:52:05 -08:00
Keavon Chambers 5115a05c5b Make grid-aligned node graph wires an experimental feature disabled by default 2025-02-21 13:27:30 -08:00
mTvare 0004bbb14b
Fix transform cage bug where aborted resize/rotate after drag is used for next resize/rotate (#2308)
* Fix the said issues

* Replace numbers with consts

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-20 23:32:40 +00:00
Adesh Gupta cf2a071fb9
Make the Pen tool extend an endpoint by starting with a colinear, equidistant handle (#2295)
* Fixed Pen extension having collienar handles

* Reformat a little

* handles being colinear for GRS

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-20 13:42:10 +00:00
mTvare 38e542e6c0
Fix regressions introduced in #2282 with the compass rose feature (#2298)
* Fix mouse states and priority order of operation

* Add metadata for tampered transform

* Add comments explaining details

* Improve comments

* Move out of bounds checks into rotate check

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-20 03:04:41 -08:00
mTvare 90a8036c47
Fix self-chaining of transforms; fix compass rose getting offset when rotating a layer (#2296)
* Fix self-chaining of transforms and compass rose under single layer

https://discord.com/channels/731730685944922173/931942323644928040/1340632846863175702
https://discord.com/channels/731730685944922173/931942323644928040/1340608972071243906

* When not invertible transformation, do nothing

* Fix overlays and compass control when can't be visible

* Simplify selection logic in compass states

* Show compass only if it was possible that it could be seen before dragging

* Prevent resizing line objects

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-17 04:28:33 -08:00
0SlowPoke0 e444785301
Make the Pen tool use Ctrl to lock the angle of handles such that they maintain colinearity (#2284)
* pen tool feature and other minor fixes

* ctrl done,need to improve handle_modifications

* completes collinear and ctrl for all cases,need to refactor

* more bug fix need to refactor

* fixed minor issues and refactor done

* Code review

* minor bug fixes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-16 23:41:55 -08:00
mTvare 687744d999
Improve grab/rotate/scale handling of pan/tilt/zoom (#2285)
* Fix P and G

* Fix (R, S) x (P, Z)

* Fix (G, Z)

* Fix R overlays

* Fix S overlays

* Fix (G, T)

* Fix last 2 fixes

* Fix mouse issues

* Cleanup

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-16 10:58:58 +00:00
Adesh Gupta 4fe3462af5
Fixed minor issues related to frontier selection visibility in the Pen/Path tools (#2291)
* Fixed issues

* Get back selection when abort

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-15 01:23:48 -08:00
Adam Gerhant 419a95e73b
Fix unresolved types in graph wires when repeatedly undoing and redoing (#2283)
fix unresolved types when repeatedly undoing and redoing
2025-02-15 06:47:48 +00:00
mTvare 70b4beab49
Add the compass rose translation gizmo to the transform cage (#2277)
* Rotate pivot and squares to orient along quad

* Add compass rose UI

* Add compass rose functionality

* Refactor code and polish things

* Fix UI

* Fix crash

* More polish

* Rework arrow to use different selection method

* Adjust for rotated layer and show when within cage

* Don't show when other modes are possible

* Fix glitchy compass

* fixes

* fixes

* WIP separate pivot and compass rose (not compiling)

* Complete file moving fixes

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-14 22:29:32 -08:00
Sidharth-Singh10 e44c460cf8
Implement initial infrastructure for the Spline tool to join itself with other splines and paths (#2269)
* merge 2 spline layers

* merge path layers with spline_tool

* merge path and spline path with spline_tool

* handle line layers

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-13 02:43:00 -08:00
Nitish Itankar 26fa8d967e
Add the style of right-angle grid-aligned wires in the graph (#2182)
* Verticle and horizontal lines achieved(#2170)

* vertical lines alligned with grid dots

* fixed vertical lines positioning

* Deals with cases 5 and 6

* Fixed case 5 and other problematic zones

* edge cases solved

* edge cases fixed: HorizontalOut & HorizontalIn

* added comments

* Changed midX and midY

* Clean up if/else statements

* Consolidate code

* Consolidate further

* Add preference for wire style

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-13 07:58:43 +00:00
Priyanshu 2d90bb0cbf
Add upgrade script to convert "Spline" node to "Path" -> "Spline from Points" (#2274)
* write document upgrade code to transfrom Spline node into Path -> Spline from Points

* fix only connecting to single output

* shift position of newly inserted Path -> Spline from Points node

* refactor

* remove all old Spline node code

* rename Spline from Points node to Spline

* Code cleanup

* Update the demo art to natively use the new Spline node

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-12 23:45:30 +00:00
Nitish Choudhary 95bbc95606
Fix scale transform being applied when drawing shapes while zoomed in (#2286)
* Nothing works a.k.a. init commit

* Everything works a.k.a. final commit

* Minor change

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-12 13:06:15 -08:00
Keavon Chambers 7bbbf7fa7c Add icons and tooltips for the previous commit's feature 2025-02-12 01:54:30 -08:00
Adesh Gupta 20a5f71bda
Add Pen and Path tool modes to avoid showing all handles (#2264)
* Path tool only show frontier overlays

* Implemented all modes for pen and path tool

* Fixed formatting issue

* Changes in selection behaviour of handles

* Selection toggle only on drag not click

* Changed comment

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-12 01:30:15 -08:00
James Lindsay f410efb8a8
Fix crash when ungrouping a direct child of the root in debug mode (#2241)
Fix crash when ungrouping a child of the root in debug mode
2025-02-11 10:45:08 +00:00
Tarun Prabhu bf3b05070c
Add a "Reverse" command to the "Order" menu (#2273)
* addded reverse for layer ordering

* added reverse to layer odering

* fixed indentation and spacing

* added reverse for layer ordering

* Added Reverse to layer ordering

* Update document_message_handler.rs

* Update document_message_handler.rs

* Cleanup, fix compiling, fix history bug

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-11 09:36:56 +00:00
Keavon Chambers ec8c8d6485
Polish and add aborting to several input widgets: no Esc closing parent menus; color picker axis align; repeat on arrow buttons (#2276)
* Remove color input outline; reduce antialiasing compositing artifacts in color widgets

* Rename ColorButton to ColorInput

* Add features and aborting to several other widgets

- Prevent Esc from closing parent floating menus when aborting
- Fix missing icon regression
- Gutter resizing abort
- Color picker aborts, Shift axis alignment, improve click/drag behavior for gradient spectrum
- Scrollbar abort, repeat when held, fix directional arrows when viewport is zoomed
- Number input abort, repeat when held

* Move ColorInput into the inputs folder

* Fix tiny logo
2025-02-10 05:46:41 -08:00
Keavon Chambers 0037f5158c Add new icons to all menu bar entries 2025-02-07 19:08:06 -08:00
Keavon Chambers 0ec91bfe01 Add pin and cut icons; improve menu bar shortcut labels to choose shortest 2025-02-05 18:30:10 -08:00
Keavon Chambers f13efd2d06 Standardize increment snapping to use the Shift key 2025-02-05 03:23:47 -08:00
mTvare 4de65c292a
Further polishing of G/R/S visualization and features (#2243)
* Further polishing of G/R/S visualisation and features

Followup to #2229.

* Begin typing only if constrained or not in G

* Prevent adding empty group in R mode. Order fn alphabetically as was before

* Always show typing hints unless can't begin typing

* Fix one frame bug

* Add cancel and confirm groups for GRS hints

* Fix inconsistency in call increments, snaps

* Use top/bottom left/right methods with quads where more readable

* Fix inconsistent use of narrow/flat

* Add hints to transform cage

Fixes https://discord.com/channels/731730685944922173/881073965047636018/939265895509925898.

* Rename some hints

* Fix scale radial behaviour, grab constraints and local edge orientation

* Fix not being able to remove the whole selection with delete modifier

Fixes https://discord.com/channels/731730685944922173/881073965047636018/1336221441716391937.

* Fix compiling

* Fix crash when single point bbox

Fixes #2267

* Fix the same crash in scale and use better name for bbox

* cargo fmt

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-05 02:57:47 -08:00
Nitish Choudhary da752e5324
Make primitive shape tools no longer draw transformed unit shapes (#2236)
* Line tool pt.1

* Line tool complete

* Fix hints

* Rectangle tool

* Fix bad naming

* Ellipse tool but cant get id

* Fix line tool

* Polygon tool

* Revert unrequested Line tool keybind change; code review cleanup

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-05 02:25:07 -08:00
Sidharth-Singh10 b60af758a9
Make joining path endpoints across layers work to merge the two layers (#2245)
* move merge_layers function to graph_modification_utils

* merge_layer before segment insertion

* Tidying up

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-05 07:25:54 +00:00
Adesh Gupta 12cd0c33a3
Fix copied/duplicated selected layers getting misordered (#2257)
* fixed duplicates ordering issues on alt drag

* Maintain order while copying

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-05 06:59:11 +00:00
James Lindsay 1f836cd2a1
Add support for skewing the transform cage by Ctrl-dragging its edges (#2251)
* Skew select bounds with ctrl

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-05 06:11:59 +00:00
Priyanshu 99a141c2e1
Fix shallow select mode not allowing a Ctrl-click select deepest if the target's ancestor is already selected (#2247)
* Fix deepselect with control key not working when shallow select mode set.

* refactor

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-04 21:39:40 -08:00
Utsav Singh 0f03762cff
Make the Select tool avoid updating hints just when clicking but not dragging (#2248)
* make Fsm update_hints function borrow tool_data and update individual tool implementations accordingly, use tool_data in select_tool update_hints function as well as add a UpdateHints response when the pointer moves after the change from  DragStart to Dragging state

* Also add for selection box drawing

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-05 04:45:57 +00:00
Keavon Chambers 0cda8e2bb4 Code cleanup around the input mapper system 2025-02-04 19:36:30 -08:00
0SlowPoke0 41ee1cf8bc
Improve the Pen tool's colinearity and equidistance controls (#2242)
* basic implementation done now refactor

* fixed overlays refactoring need to fix colinear(update it)

* more_refactoring ,only toggle C for grs to be done(if required)

* cleanup

* cleanup

* more formatting checks

* refactoring alt fixed hints fixed

* code-review-changes

* path-tool-tab-fix

* fixed bugs

* some refactor

* fixed ctrl_snap

* added lock-overlays and fixed grs bug

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-04 19:15:43 -08:00
Adesh Gupta 133d872a9f
Fix Path tool issue where the selected points could be dragged from afar within the layer interior (#2260)
Fixed point drag from inside shape

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-04 11:32:56 +00:00
Priyanshu 6d52151d60
Improve naming for variables from the lasso selection feature (#2244)
small correction in naming
2025-02-02 00:43:09 +00:00
Keavon Chambers 5fedd5c234 Fix demo artwork 2025-02-01 05:50:30 -08:00
Priyanshu 6802365e14
Add lasso selection mode (#2235)
* add document method to check intersection and insideness with polygon

* impl lasso selection

* impl lasso select to always add to selection

* add hint for lasso selection

* fix calculating selection mode based on direction on each pointer move

* fix lasso polygon lagging behing mouse position

* add overlay to draw lasso polygon with fill color same as quad

* fix comment

* change removing from selection key binding from Sift + Ctrl to just Alt

* impl Alt to shrink selection for quad in path tool

* refactor rename SelectionType to SelectionShape

* impl lasso overlay for path tool

* impl selecting anchors and handles intersection lasso in path tool

* add keys hint info

* fix converting lasso polygon to closed subpath which is has less than two points

* Code review

* impl preferences-based selection mode to the Path tool for only for overlays,

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-31 00:37:49 -08:00
Sidharth-Singh10 f462963a36
Add joining of path endpoints with Ctrl+J in the Path tool (#2227)
* feat(path-tool): ctrlJ to join endpoints

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-31 05:43:44 +00:00
Mohamed Osama 86f09be0ee
Group layers with Ctrl+G into independent groups if they're spread across artboards (#2239)
* Continuation of first attempt with unmerged PR #1992

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-30 20:27:35 -08:00
James Lindsay 5a8eb9dd1b
Make the transform cage resize about the pivot when Alt is pressed (#2226)
* Change the pivot behaviour when resizing bounds with alt in the select tool

* Add scale factor maximum

* Fix bug when encountering snapping; tidy up and comment the code

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-30 18:07:40 -08:00
mTvare fb7eae8f02
Polish the G/R/S feature behavior, visualizations, and hints (#2229)
* Fix GRS overlays bugs

- [ ] Another change: when typing values, we shouldn't round the number to 2 decimal places, instead it should show the exact number the user types, including trailing zeros if the user types those.
- [ ] For Scale, the solid vs. dashed line that follows the cursor is following the projected location of the cursor onto that line. It should not be doing that, instead it should be displaying the actual scale ratio. 0 means at the center. 1 means at the starting point of the Sscale. 0.5 means half is solid, half is dashed. Notice in my video below, I'm able to make the solid line's end go all the way to the center, which should occur at a scale factor of 0, without ever having the scale factor even go below 0.5. Because currently the two values aren't related. Furthermore, this is necessary to visualize snapping when Ctrl is pressed and to properly handle slowing when Shift is pressed.
    https://files.keavon.com/-/QuirkyYummyGrayfox/capture_38_.mp4
- [ ] Implement integer-value snapping for Grab when Ctrl is pressed? It should work whether we're freely moving or constrained to X or Y (but still mouse controlled; Ctrl doesn't affect typed numbers). So when Ctrl is held, we shouldn't see decimal values. You'll need to zoom in past 100% to see decimal values.
- [ ] We don't enter G, R, or S mode until after pressing one of those keys and then moving the mouse cursor. It should happen immediately upon pressing the key, before needing to move the cursor.
- [ ] The hints need to be updated to work dynamically with the state of global vs. local X and Y constraint, and include - negation, numbers, and Backspace if numbers are typed.
- [ ] In the Path tool, we actually do want the Rotation to start from the direction of the cursor rather than the local rotation of the layer. So if you can undo that change specifically for the Path tool, but keep it for the Select tool, that would be ideal.
- [ ] When G is constrained to Y in both Path and Select tools, the number label shouldn't swap sides based on moving the mouse left and right offset by the pivot-to-start-point X offset distance. Alternatively, you could keep this behavior but make it swap to the side that the mouse is currently on (removing the pivot-to-start-point X offset from the current mouse position). When solving this, just be sure you don't break the correct behavior for G when unconstrained to an axis, since we like how the Y component label swaps sides. Please also double-check that you're not drawing any extra (overlapping) overlay lines than the necessary 1 when in X or Y constraint mode, or when X or Y happen to be precisely 0. https://files.keavon.com/-/EachWeeArcticseal/capture_39_.mp4
- [ ] Remove the bottom-left viewport overlay labels for the G/R/S status

* Remove bottomleft GRS overlay

* Fix backspace minus

* Implement integer-value snapping for Grab when Ctrl

* Use built-in coordinates for translation

* Show the exact value in Typing including trailing zeros

* Make rotation overlay start along the cursor rather than the local rotation of the layer in path tool

* Properly handle slow down and other effects on scale

* Start the transformation overlay immediately rather than after first change

* Hints for typing and global/local axes

* Prevent drawing overlapping if X or Y is 0

* Fix number being replaced by - when in negated transformation

* Fix fixes

* Invert scale delta in inverted mode

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-30 15:29:17 -08:00
Keavon Chambers 303c1d45f8 Avoid adding an unnecessary Transform node with the TransformChange message 2025-01-30 03:17:31 -08:00
Mohamed Osama 618190d6e4
Fix Document > Clear Artboards so it doesn't also clear everything else (#2177)
* Clear Artboards, Closes #2015

* Memory optmization

* - Fix transactions
- Fix node positions
- Optimize nodes' deletion

* no message

* Fix layers shift to wrong positions

* fix bugs

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-30 01:29:24 -08:00
mTvare a0f8f89e71
Make the transform cage show/hide resize grips as space allows (#2209)
* Changes rotation handles to be around overlay squares

Fixes https://discord.com/channels/731730685944922173/931942323644928040/1330785941786329209

* Fix zero width objects not being selected by slightly nudging the transform

* Follow the categorical limits to render overlay quads

As discussed here: https://discord.com/channels/731730685944922173/931942323644928040/1331166336923074600

* Replace area based calculations with edge based calculations

* Fix 3rd category vis

* Code review

* Add missing powi(2)

* Fixes to handle logic

* Remove single axis prioritisation

* Explicitly check for distance to find nearest handle

* Replace threshold check based on corner vis bounds

* Fix discrepancy at h=12px

* Allow grab when box is too small by disabling resizing within bounds

* Replace inside resize pixel limit

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-30 01:10:40 +00:00
James Lindsay c5a3c32114
Fix regression causing pasted images to have a zero-size transform (#2238)
* Use the identity matrix as the default for an image frame

* Fix all usages to be equivalent to their pre-refactor versions, opting to keep ZERO not IDENTITY as the default image size

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-29 21:09:02 +00:00
James Lindsay dbf917ef71
Fix a minor regression in monitor nodes with VectorData (#2237)
* Fix a minor regression in monitor nodes with VectorData

* Use type alias instead of full type

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-29 11:53:46 -08:00
mTvare 95f6bb82ff
Fix regression where Pen tool resumes segment placement after returning from another tool (#2234)
Fix penfsm not clearing resources and returing to ready when aborting

Fixes https://discord.com/channels/731730685944922173/1332187131623506095/1333775276160585788.
2025-01-29 03:39:28 -08:00
Keavon Chambers eb0ff20d3c
Instance tables refactor part 1: wrap graphical data in the new Instances<T> struct (#2230)
* Port VectorData to Instances<VectorData>

* Port ImageFrame<P> and TextureFrame to Instances<ImageFrame<P>> and Instances<TextureFrame>

* Avoid mutation with the TransformMut trait

* Port GraphicGroup to Instances<GraphicGroup>

* It compiles!

* Organize debugging

* Document upgrading

* Fix Brush node

* Restore TransformMut in lieu of TransformSet trait

* Fix tests

* Final code review
2025-01-28 23:51:12 -08:00
Adam Gerhant 408f9bffa1
Fix regressions from #2105 (more control over subgraph imports/exports handling) (#2213)
* Fix regressions

* Fix copy to points properties

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-26 20:19:11 +00:00
0SlowPoke0 9e2bda36b0
Add G/R/S to the Pen tool to control the outgoing segment handle (#2211)
* more_refactoring_solve_conflict

* overlays-target-fix

* Code review

* select-broken-fix

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-26 04:14:51 -08:00
Pratik Agrawal 96c57605b7
Add an editor preference for touched/enclosed/directional based selection (#2156)
* implemented left selection logic

* added logic for right ward selection

* removed the logs code

* corrected capitalization error

* corrected capitalization error

* added radio buttons for selection_mode

* fixed multiple selection of checkboxes

* adapted to the RadioEntryData

* State management bug

* integrated message system to selection_mode

* updated

* updated

* added selection mode to transition arms

* removed from portfolio message and added preference in ToolMessageData

* removed dead code of selection_mode from frontend logic

* removed dead code for zoomWithScroll

* Cleanup

* Rename, simplify, use dashed box, and highlight only outlines of layers that'll get selected

* More code review

---------

Co-authored-by: Pratik Agrawal <patrik@Pratiks-MacBook-Air.local>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-26 06:34:37 +00:00
James Lindsay 93880abc4c
Experimental vector meshes (#2223)
* Experimental vector meshes

* Clarify limitations in label and tooltip

* Restore old traversal direction

* Fix Bezier-rs crashes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-25 17:13:35 -08:00
James Lindsay 26d66298cf
Give the current snapping target layer(s) an outline (#2224)
* Outline layer when snapping

* Outline layers when snapping to anchors
2025-01-25 13:00:01 -08:00
Priyanshu f7b7f6b9f4
Implement extending, joining, and creating new subpaths with the Spline tool (#2203)
* visualize spline end points using overlays

* implement for spline tool to extend path by draging end points

* allow holding Shift to begin drawing a new spline subpath in the same layer

* implement spline tool to join two endpoints

* fix naming

* refactor spline tool

* impl spline tool snapping and overlays

* fix joining path and refactor

* improve join_path comment

* fix snapping overlays flickering by ignoring snapping in current layer

* fix inserting single point on aborting spline tool

* add snapping for endpoint even when regular snapping is disabled

* fix extending

* fix inserting new point instead of extending and Add hint for Shift to append

* fix grammatical errors and code style

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-25 11:24:08 +00:00
Andy Day 33ac141fb8
Fix blurry overlay rendering when the pixel display ratio isn't 100% (#2204)
* support hi dpi overlay rendering

* Code review and make scaling ratio dynamic

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-25 09:37:49 +00:00
mTvare 9954e49530
Make the document auto-save system initially restore the last-viewed tab before loading the rest (#2194)
* Fixes last tab being opened instead of last active tab

Fixes https://discord.com/channels/731730685944922173/881073965047636018/937518022548131891

* Defers node initialisation to SelectDocument message instead of load_document

* Fix warning regarding attempt to load closed document

* Defer loading resources and running nodes to selection time

* Make last active tab load before others

* Load last active saved document instead of last autosaved doc

* Fix failing tests

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-25 06:41:47 +00:00
mTvare de36d4967d
Add visualization overlays to G/R/S (#2195)
* Make HintInfo label use Cow<'static, str> instead of String

Fixes https://discord.com/channels/731730685944922173/881073965047636018/931942323644928040

tmp, will amend later

* Replaces dynamic hint used by transform layer with overlays

* Adds a scaling factor accounting for document and viewport scales

Also moves whole code to single unit

* Make overlays relative to viewport rather than document

* Add visualization overlays to G/R/S in the Select tool

* Prevents quick measurements from showing up when resizing bounds

Fixes https://discord.com/channels/731730685944922173/881073965047636018/1328282633456713762

* Add local axes which activates on double constraints.

* Handle the bounding box of a collection of layers as select tool does

* Replaced hard coded transparent color and removed debug! which slipped in

* Make rotation axes start along local axis

* Fix typed distance being in doc space and negatives

* Fix missing undo transactions for some actions

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-24 23:31:55 +00:00
Sidharth-Singh10 3048466e86
Remove errant line following cursor in snap overlays during constrained line drawing (#2206)
* fix(line-tool): disable snap overlays during constrained drawing

* Update editor/src/messages/tool/tool_messages/line_tool.rs

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-24 14:10:01 -08:00
Ayush Chauhan 6effb2d6e6
In Path tool when dragging a handle, make Alt recover the opposing handle if it's not cubic rather than zero-length (#2196)
* follow up for PR #2160

* now `alt` restores zero-length handles

* Update editor/src/messages/tool/tool_messages/path_tool.rs

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-24 08:49:43 +00:00
mTvare 37db9b1392
Retain transforms of layers when transferred between transformed groups (#2212)
* Retain position of layers when transfered between artboards.

Fixes #861

* Apply same fixes to grouped layers
2025-01-23 13:22:41 -08:00
Keavon Chambers 8505ed3f10
Improve older document upgrading compatibility and make node type errors clearer (#2201)
* Improve older document upgrading compatibility and make node type errors clearer

Misc.

* Fixes

* Avoid unwrap
2025-01-21 01:40:43 -08:00
Adam Gerhant eec0ef761c
Polish user-created subgraph nodes: imports in the Properties panel; reorder/delete/rename imports/exports (#2105)
* Remove imports/exports

* WIP: Autogenerated properties

* WIP: Input based properties

* WIP: Hashmap based input overrides

* Migrate noise pattern node to input properties

* Reorder exports

* Continue migrating properties

* WIP: Improve reorder exports

* Automatically populate all input properties for sub networks

* Complete reorder import and export

* Add widget override to node macro

* Migrate assign colors to input based properties

* WIP: Full node property override

* Node based properties override for proto nodes

* Migrate all node properties to be input based

* Rename imports/exports

* improve UI

* Protonode input valid implementations

* Valid type list

* Small formatting fixes

* Polishing small issues

* Document upgrade

* fix tests

* Upgrade noise pattern node

* remove console log

* Fix upgrade script for Noise Pattern

* Improve the Properties panel representation for graphical data

* Re-export demo art

* Code review

* code review improvements

* Cleanup for node properties overrides

* Reexport demo art

* Fix clippy lints

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-20 21:13:14 -08:00
mTvare ad68b1e5c8
Restore Pen tool undo/redo and fix incorrect triggering of undo when changing tools (#2193)
Fixes ghost anchors, and allows undo in pentool

Fixes https://discord.com/channels/731730685944922173/881073965047636018/1267365764231598186.
Fixes https://discord.com/channels/731730685944922173/881073965047636018/1327376421034922045.
Fixes #2152.

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-18 23:46:28 -08:00
0SlowPoke0 5aedda0ce8
Add handle visualization during point insertion in the Path tool (#2197)
* added_handle_overlays

* changed color to yellow

* Rename color parameter

* Change the color to blue

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-15 10:39:41 +00:00
Priyanshu 0a496ee452
Change Spline tool behavior to use Path and Spline from Points nodes instead of legacy Spline node (#2200)
* use Path and Splines from Points node to build spline replacing Spline node

* fix point being added on drag start event in spline tool
2025-01-15 01:38:21 -08:00
0SlowPoke0 2e4fb95dea
Add Path tool support for G/R/S rotation and scaling with a single selected handle (#2180)
* grab_scale_path and backspace for pen

* minor improvements and fixes

* code-review changes

* Avoid more nesting, and other code cleanup

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-15 08:37:02 +00:00
Keavon Chambers 9ad6c31483
Remove blob URL dead code and clean up more frontend code (#2199) 2025-01-14 13:08:47 -08:00
Keavon Chambers 1e62af88cd Remove trailing zeros in rendered SVG path output 2025-01-13 02:56:33 -08:00
mTvare 8dfdc2b98f
Update the bounding box snapping modes to use Align with Edges for edges and alignment (#2185)
* Fix snapping to respect rotation of bounding box

Fixes snapping behaviour which defaulted to X and Y axes.

* Remove redundant align along edges

* Code review

* Update manual

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-13 10:53:32 +00:00
mTvare d692538736
Make the Text tool delete empty text layers when clicking away wth LMB (#2192)
Fix additions of layers when using left click

Fixes: https://discord.com/channels/731730685944922173/881073965047636018/1327376421034922045
2025-01-12 18:17:44 -08:00
Keavon Chambers 3582126ded Remove the Pen tool's anchor square under the cursor when drawing a not-yet-placed segment 2025-01-10 13:12:51 -08:00
Keavon Chambers 51d1c4eeac Fix drawing new layers not being put next to nested selected layers
A regression introduced in #2110
2025-01-09 20:37:49 -08:00
Keavon Chambers 07601a5c6c Improve snapping with better snap target names, tooltips, cleaner overlay labels, code cleanup 2025-01-09 19:03:14 -08:00
Keavon Chambers 9eb544df74 Rename "options/top bar" terminology to "control bar" and update comments 2025-01-07 17:33:45 -08:00
Keavon Chambers 1c880daea2 Fix isometric dotted grid and avoid antialiasing on dashed line overlays 2025-01-07 17:27:35 -08:00
Nitish Choudhary 66357540bb
Add max width/height to text layers and draggable text boxes to the Text tool (#2118)
* Make progress in text tool

* Add line_width to gcore and gstd

* minor fix

* Dragging sets line_width correctly

* Get draw overlay to work

* Typo fix

* Make progress in text tool

* Add line_width to gcore and gstd

* minor fix

* Dragging sets line_width correctly

* Get draw overlay to work

* Typo fix

* Improve text bounding box

* Add toggle for editing line width

* Take absolute value of drag

* Fix optional properties

* Code review

* Attempt to add box height and abort with keys

* Attempt to add key modifiers and snap manager

* Use resize for improved dragging

* Refactor typesetting configuration into a struct

* Fix missing px unit in frontend

* Remove lines on rendered text

* Fix backwards compatibility

* Refactor lenient slection as an associate function in tool data

* Add dashed quad to text nodes

* Use correct names for max height and width

* Additional renames and reorder

* ReResolve conflict

* Code review and improvements

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-31 20:50:47 -08:00
Sidharth-Singh10 f225756655
Fix text layer getting deselected after clicking out of Text tool interactive editing (#2144)
* properties panel remains active when user edits text layer

* Keep text layers selected after editing

* Update editor/src/messages/portfolio/document/document_message_handler.rs

* Delete Empty Text Layer on Escape or Right Click

* Fix: delete empty text layer on right click

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-31 14:28:56 -08:00
Ayush Chauhan 39a7b76ade
Add snap and lock angle modifiers for handle dragging to the Path tool (#2160)
* added snap and lock angle to path tool

* fixed breakage of `tab` and `space` functionality
- Previous implementation broke functionality of using Tab to swap the being-dragged handle to its opposing handle, Now fixed.
- Previous implementation broke functionality of using space to drag the manipulator group (anchor + handles) while dragging a handle, Now fixed.

* fixed the angle snapping and locking when used together
Now, if `shift` is used to snap to a 15° increment, then `ctrl` is used to preserve the angle, releasing the `shift` key will still preserve the angle.

* Fix snapping angle logic

* Improve transforms

* added functionality for `alt` key
Now, temporarily converts selected handles to colinear if they are not already colinear.

* Revert "added functionality for `alt` key"

This reverts commit f12ba6fdbf261291ced0e042a2dfe12cddd2f9e8.

* Code review

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-31 19:48:14 +00:00
Pratik Agrawal 606be8a74b
Make the Artboard tool shift its contents if resizing from the top/left so artwork is stationary (#2166)
* added fetch child layerfunction

* Simplify

---------

Co-authored-by: Pratik Agrawal <patrik@Pratiks-MacBook-Air.local>
Co-authored-by: hypercube <0hypercube@gmail.com>
2024-12-31 18:52:05 +00:00
Nitish Choudhary 2293da7d98
Improve Text tool click targets on text layers to use the text box (#2145)
* Fix text selection

* Remove old implementation

* minor change

* Use inbuilt function instead of helper

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-28 22:11:27 +00:00
0SlowPoke0 6c3c2e8529
Add selection removal to the Select tool's box select (Ctrl+Shift modifier) (#2162)
* select parent-node,remove deselect all layers message

* Comment nits

* implement negative selection box

* moved comment and formatting

* Apply suggestions from code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-28 11:43:29 +00:00
Utsav Singh 6d737f15ee
Improve quick measurement overlays with better number alignment and decimal rounding (#2155)
* Tidy up number text alignment and decimal precision for quick measurement overlays

* Tidy up number text alignment and decimal precision for quick measurement overlays

* Tidy up number text alignment and decimal precision for quick measurement overlays

* Tidy up number text alignment and decimal precision for quick measurement overlays

* Tidy up number text alignment and decimal precision for quick measurement overlays

* Tidy up number text alignment and decimal precision for quick measurement overlays

* Tidy up number text alignment and decimal precision for quick measurement overlays

* Tidy up number text alignment and decimal precision for quick measurement overlays

* Formatting changes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-28 00:45:26 -08:00
Keavon Chambers feba87449b Add more actions to the Layer menu bar entries 2024-12-26 16:31:13 -08:00
0SlowPoke0 a6676e4abd
Fix Select tool's box selection not being able to extend a selection with shift (#2157)
* select parent-node,remove deselect all layers message

* Comment nits

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-24 23:10:43 -08:00
0SlowPoke0 77936c44b0
Make Path tool deselect all points on single-click, and select all on double-click, of shape's fill (#2148)
* Implement deselect on single-click and select all anchors on double-click

* fixed the single_click_behaviour

* fix flipSmoothSharp when doubleclick and drag

* Cleanup and Clippy fixes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-22 21:59:59 -08:00
Utsav Singh a1dc9556af
Improve quick measurement overlays across all possible arrangement scenarios (#2147)
* setup single edge crossing handling for quick measure tool

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects.

* setup single edge crossing handling for quick measure tool

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects.

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects.

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects.

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects. Add a dashed_line_with_pattern function that gives more granular control over dash_width and gap_width.

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects. Add a dashed_line_with_pattern function that gives more granular control over dash_width and gap_width.

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects. Add a dashed_line_with_pattern function that gives more granular control over dash_width and gap_width.

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects. Add a dashed_line_with_pattern function that gives more granular control over dash_width and gap_width.

* Nit picks

* Define wrapper for Overlay_context line method

* Comments and consolidating lines of code

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-22 19:20:03 -08:00
Utsav Singh bc47d06139
Fix transform cage rotation abort causing broken state upon next transformation (#2149)
Fix abort functionality on Right Click when performing transformations using select tool
2024-12-22 01:54:30 -08:00
James Ryans 3be7505faf
Automatically place layers into the artboard they're drawn inside of (#2110)
* place new layer from basic tools within an artboard bounds

Signed-off-by: James Ryans <james.ryans2012@gmail.com>

* add for Text Tool

Signed-off-by: James Ryans <james.ryans2012@gmail.com>

* use click_xray function

Signed-off-by: James Ryans <james.ryans2012@gmail.com>

* support for freehand tool

Signed-off-by: James Ryans <james.ryans2012@gmail.com>

* support spline tool

Signed-off-by: James Ryans <james.ryans2012@gmail.com>

---------

Signed-off-by: James Ryans <james.ryans2012@gmail.com>
2024-12-20 19:02:00 -08:00
Ayush Chauhan 337b8bad13
Improve issues with selection history (#2138)
* Selection history when creating a new layer

* fixed selection history

* cleaned up the code, removed duplicate network_metadata calls

* re: fixed selection history
Added a default value for selection_undo_history to make sure its never actually empty.
2024-12-20 13:56:33 -08:00
Keavon Chambers ed119ad3d7 Add Freehand tool drawing new subpaths on an existing layer with Shift held 2024-12-17 22:01:42 -08:00
Jacin Yan 3423c8ec13
New node: Math (#2121)
* 2115 IP

* Initial implementation of Expression node

* Register Expression Node

* Add Expression DocumentNode Definition

* DocumentNodeImplementation::Expresssion in guess_type_from_node

* Move expression.rs to graphene-core

* WIP: Investigating 'exposed' & 'value_source' params for Expression property

* Node graph render debug IP

* Single input can change node properties; complex debug IP

* Fix epsilon in test

* Handle invalid expressions in expression_node by returning 0.0

* Run cargo fmt

* Set the default expression to "1 + 1"

* Hardcode the A and B inputs at Keavon's request

* Rename and clean up UX

* Move into ops.rs

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-17 07:08:14 +00:00
Keavon Chambers 1264ea8246 Tidy up the UI with clearer Layers panel selection marks and removal of most "coming soon" UI elements 2024-12-14 20:49:21 -08:00
James Lindsay fc0cf604df
Update some dependencies (#2134)
* Update some dependencies

* Update to action v2

* Fix for v2
2024-12-12 18:28:49 +00:00
0SlowPoke0 d97b02506e
Fixes shortcut key not showed in File->Close (#2135)
removed_the_dead_code_from_the_commit
2024-12-07 18:06:16 +00:00
James Lindsay b21b1cbfc7
Simplify the implementation of the message buffering (#2123)
* Simplify the implementation of the message buffering

* Add assert to ensure list is empty
2024-12-02 20:48:33 +00:00
James Lindsay e3bb11ec1b
Fix clippy lints (#2119) 2024-11-29 22:58:49 +00:00
0SlowPoke0 00629571f2
Disabling colinear state when both the handles are selected and moved (#2120)
* disable collinear state

* Add comment

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
2024-11-29 22:58:28 +00:00
Pratik Agrawal 2cf33e45bd
Remove Double-Click Behavior for Switching to Path Tool on Non-Path Layers (#2116)
* Remove double-click behavior for switching to Path tool on non-Path layers

* removed the else-if block

* removed the path tool activation from shallowm mode

---------

Co-authored-by: Pratik Agrawal <patrik@Pratiks-MacBook-Air.local>
2024-11-26 16:33:14 +00:00
James Lindsay 51ce51ea8c
Refactor collection of snap targets (#2114)
* Collect snap targets cleanup

* Make Clippy happy

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-20 22:27:49 -08:00
Keavon Chambers 99cf8f0c4f Clean up editor preferences dialog 2024-11-15 18:47:50 -08:00
Adam Gerhant 4250f291ab
Add merging nodes into a subgraph with Ctrl+M and basic subgraph signature customization (#2097)
* Merge nodes

* Fix bugs/crashes

* WIP: Debugging

* Fix bugs, add button

* Add imports/exports

* Improve button

* Fix breadcrumbs

* Fix lints and change shortcut key

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-12 14:27:42 -08:00
Keavon Chambers 4c4d559d97 Fix crash when upgrading a document with a Modulo node from 3 commits ago 2024-11-12 13:55:03 -08:00
James Ryans ee2d4a03db
Make Pen tool always snap to endpoint anchors, even when snapping is off (#2107)
* pen should always snap on last anchor

Signed-off-by: James Ryans <james.ryans2012@gmail.com>

* snap anchor on every single connected points

Signed-off-by: James Ryans <james.ryans2012@gmail.com>

---------

Signed-off-by: James Ryans <james.ryans2012@gmail.com>
2024-11-12 13:53:55 -08:00
James Lindsay 3ce1317053
Make the Pen tool only append new paths when Shift is held (#2102)
* Append to a path with shift

* Fixup transforms

* Revert unnecessary transform change

* Fix delete node button transaction

* Prevent artboard from being selected after making a new document

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-11 15:14:32 -08:00
Keavon Chambers d649052255 Upgrade and document the math operation nodes 2024-11-09 23:23:25 -08:00
Keavon Chambers de366f9514 Add Brush tool warning; move font list loading to document creation time 2024-11-09 12:27:09 -08:00
Keavon Chambers 457619794b
Improve nudging when tilted and add Artboard tool nudge resizing; disable menu bar entries when no layer is selected (#2098)
* Make nudging follow a tilted viewport

* Add artboard nudge resizing
2024-11-08 16:16:20 -08:00
November-6 b3a196c0b6
Fix point nudging to work in document space (#2095)
* Modified Path tool Behaviour

* Make the code simpler and more self-descriptive

* Make it work for transformed layers

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-05 22:27:31 -08:00
Keavon Chambers f1b0d8fa87
Improve the node graph with revamped top bar and disabling tools when graph is open (#2093)
* Add "Fade Artwork" slider and disable tools when graph is open

* Add navigation and layer/node management buttons to graph top bar

* Reduce code duplication
2024-11-04 20:41:53 +00:00
Keavon Chambers 12ca06035c Hide the left border notch in layers when a wire isn't entering from the layer's left 2024-11-03 15:33:29 -08:00
Dennis Kobert 35f7cfac80
Parse description from node doc comments (#2089)
* Parse description from node doc comments

* Add node description tooltips

* Code review

---------

Co-authored-by: Adam G <adamgerhant@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-03 14:57:20 -08:00
Keavon Chambers 8d3da83606 Avoid sometimes breaking the selected layer upon switching away from the Select tool 2024-11-02 18:55:57 -07:00
adamgerhant c7b08246c2
Allow the Pen tool to connect layers by their endpoints, merging into a single layer (#2076)
* Merge vector data layers

* Fix early return

* Fix layer space multiplication error

* Recalculate positions when changing layer space

* Add transform node

* Remove pen tool layer state
2024-11-01 12:19:46 -07:00
Daragh 018e9839f8
Add Path tool support for the Tab key swapping to dragging the opposite handle (#2058)
* feat: tab alternates between handles

* fix: handle hints, remove anchor to handle switch
Added specific handle hints,
Can no longer switch to handle if just anchor is selected
typo fix

* fix: no longer deselect on esc/rclick

* feat: hides cursor when switching
A pointerlock implementation would be ideal in the future to keep the screen from panning,

* fix: tidy up dynamic tool hints
switch colinear to V

* fix: can no longer hide cursor if anchor selected
remove debug statement

* fix: clippy

* Solve some issues and remap V to C to toggle colinear

* Cleanup + change equidistant key from Shift to Alt

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-30 02:48:20 -07:00
James Lindsay c27d8dc5dc
Fix layer name text input (#2081) 2024-10-26 13:25:51 -07:00
adamgerhant ff8fec6eca
Allow the Path tool to edit an upstream path even if there's a type conversion midway (#2055)
Remove type check when iterating upstream

Convert to doc comment
2024-10-26 18:39:48 +00:00
Daragh b1399af5cd
In the Path tool, make Space shift the anchor while dragging handles (#2065)
* in progress:

* cherry-pick

* works kinda, fails when holding down space

* seems to be working

* naming

* fix :clippy

* fix: put back in newline

* fix: add overlay draw message

will now visibly select points when pressing space instantly as opposed
to when its moved

* cleanup + rename

* refactor to use refresh keys

* fix: naming

* add back in todo

* :)

* fix: Small bugs relating to space handle selection

If release mouse before space, reselect previous points and unselects points
selected by space.
If only anchor is selected it will not select handles.
Removed comment as its now clear what its doing / where its coming from
2024-10-26 09:20:08 +00:00
James Lindsay 5aa6716910
Add a node insertion button and layer renaming from the Properties panel (#2072)
* Add node button

* Improve css a bit

* Add layer renaming to the Properties panel and move New Layer to that, plus add unpinning to properties sections

* Add tooltip

* Re-add layer itself in listing

* Final code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-25 23:58:34 -07:00
Mohamed Osama 3c839ffd2b
Clean up old usages of `NodeId(generate_uuid())` by replacing it with `NodeId::new()` (#2009)
Replace all `NodeId(generate_uuid())` with `NodeId::new()`
2024-10-25 19:43:46 -07:00
RyanRothweiler 63d44f22e3
Fix Text tool clearing text when hitting Escape by changing it to commit the edit instead (#2052)
* Text tool escape sends commit message

* Improve hint text

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-25 18:12:54 -07:00
James Lindsay 79408fc0cc
Fix alignment snapping not preserving aspect ratio when Shift is held (#2062)
Fix align with a diagonal constraint
2024-10-25 17:34:23 -07:00
adamgerhant fd20d51e85
Fix various crashes and bugs (#2075)
* Fix offset brush tool

* Fixes
2024-10-25 16:54:37 -07:00
adamgerhant 6b1356fe13
Allow multiple top output wires to come from layers (#2049)
* Allow multiple outputs from layer

* Stable Ids for Flatten Vector Elements

* Clippy
2024-10-25 22:32:31 +00:00
James Lindsay 9f7b3936f4
Fix brush tool broken by #2011 (#2045)
Brush tool fix
2024-10-16 20:04:33 +00:00
adamgerhant e09f5ecaec
Make Copy to Points and (Circular) Repeat and nodes output group data, and add flattening nodes (#2011)
* Output group from repeat, add flatten vector elements

* Fix tests

* Fix demo artwork

* Output group from copy to points, add repeat for graphic groups, fix editor freeze on render fail

* Restore painted dreams

* WIP: Fix demo artwork

* Fix demo artwork, add ungroup node

* Incorrect scaling

* fix test

* Fix demo art

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-14 12:39:28 -07:00
James Lindsay b028bbb8cc
Fix crash from empty document with no artboards introduced in #2028 (#2036)
* Fix me crashing the editor due to not paying attention

* Swap two lines for consistency

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-14 18:24:51 +00:00
James Lindsay a761e7803e
Improve text overlay styling and fix artboard label positioning bug (#2032)
* Improve text overlays

* I can't test code
2024-10-13 21:35:50 +00:00
fiveeyy 5c98378c7a
Fix Ctrl+H layer hiding and Ctrl+L layer locking only working with the graph open (#2029)
* Add DocumentMessage::ToggleSelectedVisibility

* Add DocumentMessage::ToggleSelectedLocked

* Update editor/src/messages/input_mapper/input_mappings.rs

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-13 14:19:46 -07:00
James Lindsay d6f46f73da
Factor in artboard clipping to the click target x-ray function (#2028)
* Add clipping to the click xray function

* Clip area rays as well

* Code review nits

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-12 23:38:17 +00:00
James Lindsay 3b0e9587eb
Update Wasm dependencies to fix WebGPU spec change crash in Firefox with Vello (#2027)
* Update wasm deps

* Bump wasm-bindgen and fix the depricated methods
2024-10-12 14:28:39 -07:00
Keavon Chambers f7d83d2632
New node: Offset Path (#2030)
* New node: Offset Path

* Fix CI
2024-10-11 14:50:54 -07:00
Keavon Chambers 7a56af01ef Fix the Scatter Points node 2024-10-10 13:45:51 -07:00
adamgerhant dc46959274
Fix double clicking anchor to convert between smooth and sharp (#2023)
* Buffer after undo

* Quick thumbnail fix while I'm thinking about it

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-07 13:13:52 -07:00
Keavon Chambers fa6b5f298a New demo artwork: "Changing Seasons" 2024-10-04 16:31:22 -07:00
Keavon Chambers e6d8c4743d Add support for pinning nodes in the Properties panel 2024-10-03 16:26:40 -07:00
Dennis Kobert d2f791cfb3
Make Upload Texture node resolution-aware (#2018)
* Make UploadTextureNode resolution aware

* Add TextureFrame implementations for MonitorNode

* Add TextureFrame implementation to TransformNode
2024-10-03 10:32:34 -07:00