* 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
* 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
* 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>
* 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>
* 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>
* 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>
* 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
* 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>
* 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
* 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
* 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>
* 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>
* fixed deep-select and overlays
* minor fix
* made minor fixes in filtering
* small fix
* Code review
---------
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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()`
* 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
* 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>
* 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>
* 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>
* 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>
* WIP, for TrueDoctor to continue
* Expose first implementation type as default type in field metadata
* Cleanup
---------
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* 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>
* 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>
* 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>
* Fixed Pen extension having collienar handles
* Reformat a little
* handles being colinear for GRS
---------
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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
* 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>
* move merge_layers function to graph_modification_utils
* merge_layer before segment insertion
* Tidying up
---------
Co-authored-by: Keavon Chambers <keavon@keavon.com>
* 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>
* 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>