* 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>
* 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>
* 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>
* 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>
* 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>
* Fix a minor regression in monitor nodes with VectorData
* Use type alias instead of full type
---------
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* 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
* 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>
* 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>
* 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>
* 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>
* added_handle_overlays
* changed color to yellow
* Rename color parameter
* Change the color to blue
---------
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* 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>
* 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>
* add function to calculate if a subpath is inside polygon
* make is_subpath_inside_polygon() flexible
* obtimize is_subpath_inside_polygon function
* move is_inside_subpath function to Subpath struct method
* add interactive demo for subpath insideness
* Code review
---------
Co-authored-by: Keavon Chambers <keavon@keavon.com>