Commit graph

978 commits

Author SHA1 Message Date
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]: 1345339390

* 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 1328281947
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 1344594798

* 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