* Avoid allocating a Vec when precomputed segments lengths is provided.
* improved using option type.
* we don't even need option type as Vec::new() doesn't allocate.
* clean up
* fix naming
* refactor sample_points node/function.
* avoid recalculating segments length to find point on bezpath.
* cleanup
* rename few variables
* fix transformation and use precomputed segment lengths
* write comments
* set POSITION_ACCURACY and PERIMETER_ACCURACY to smaller value to get better approximate euclidean position on a path
* fix segment index when t value is 1.0
* Improve comments
* move sampling points code into a separate function
* it works! finding the segment index is linear now!
* small fix and improve variable names & comment
* Naming
* evaluate segment at t as euclidean distance. fix.
* improve comment & variable name
---------
Co-authored-by: indierusty <priyaayadav@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* 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>
* Fix min and max macro not enforcing limits when data flows
* Use trait based clamping
* Remove min/max from testing
* cargo fmt
* Resolve into min, and hard_min
* cargo fmt
* fix traits
* cargo fmt
* fix tests
* rename as soft_x
* Add validation code
* Clean up (not compiling because of DVec2 clamping)
* Avoid needing to add trait bounds to node definitions
* Code review
---------
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* 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>
* rough refactor of Position on Path node
* refactor
* refactor 'Tangent on Path' node implementation to use kurbo API
* Code review
---------
Co-authored-by: indierusty <priyaayadav@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* 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>
* 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>
* 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
* 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>
* 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>
* 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>
* 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>
* 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>