Commit Graph

96 Commits

Author SHA1 Message Date
Priyanshu 6d52151d60
Improve naming for variables from the lasso selection feature (#2244)
small correction in naming
2025-02-02 00:43:09 +00: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
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 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
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
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
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
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
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 1e62af88cd Remove trailing zeros in rendered SVG path output 2025-01-13 02:56:33 -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
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
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
James Lindsay e3bb11ec1b
Fix clippy lints (#2119) 2024-11-29 22:58:49 +00: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
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
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
adamgerhant 70dacac474
Refactor navigation metadata (#1956)
* Fix path tool select

* Refactor rounded edge distance

* comment

* Fix demo artwork

* Fix comments

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-05 19:53:37 +00:00
adamgerhant 19541c9684
Fix broken SVG importing and crash when exporting (#1953)
* Fix importing SVG and crash when exporting

* Code improvements, prevent entering network after drag
2024-09-03 06:54:51 +00:00
adamgerhant 9adc640f19
Improve layer positioning in graph upon reordering; improve history system; add selection history (#1945)
* Improve layer positioning

* Collapse space when deleting

* Improve moving layers in layer panel

* Improved transactions

* Selection history

* Code review

* Select previous selection when aborting

* Fix crash and artboard select

* Add mouse forward/back button selection history bindings

Code review

* Menu buttons

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-09-01 02:34:18 -07:00
adamgerhant 2bd213f1aa
Improve layer panel positioning for upstream nodes (#1928)
* Improve layer panel positioning for upstream nodes

* highlight parents

* Final improvements

* Fill for selection box, bug fixes

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-08-14 03:27:42 -07:00
James Lindsay 1f278799d6
Add quick measure overlays with Alt pressed (#1894)
* Measure with alt

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-08-10 04:56:02 -07:00
James Lindsay cdd179cf10
Add snapping targets for b-box edges and multi-layer spacing distribution (#1793)
* Initial work on aligning bounding boxes

* Work in progress distribution

* Distribution snapping

* Distribution overlays

* Align points and clean up

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-08-04 22:12:20 -07:00
adamgerhant 0dbbabe73e
Add layer node chains, import/export edge connectors, and refactor graph editing to go thru a NodeNetworkInterface (#1794)
* WIP: NodeNetworkInterface

* Organize ModifyInputsContext to use network interface

* Improve ClickTarget and Position state

* Rework ClickTarget state

* Continue fixing NodeGraphMessageHandler

* Restructure network_metadata

* Final(?) NodeNetworkInterface struct

* Final(??) NodeNetworkInterface

* Final(???) NodeNetworkInterface. Separated persistent and transient data

* Final NodeNetworkInterface data structure. Implemented all basic getters

* Continue migrating functionality to network interface

* Migrate all NodeGraphMessage's to use network interface

* Fix all helper functions in NodeGraphMessageHandler

* Move document metadata to network interface, remove various cached fields

* Move all editor only NodeNetwork implementations to NodeNetworkInterface

* Fix all DocumentNodeDefinitions

* Rework and migrate GraphOperationMessages to network interface

* Continue migration to NodeNetworkInterface

* Save point before merging master

* Fix all errors in network_interface

* 850 -> 160 errors

* Fix all errors :D

* Render default document

* Visualize click targets

* merge conflicts

* Cache transient metadata separately, store entire interface in document history

* Start migration to storing selected nodes for each network

* Remove selected nodes from document message handler

* Move outward wires and all nodes bounding box to transient metadata

* Fix connecting/disconnecting nodes

* Layer stack organization for disconnecting/connecting nodes

* Basic chain locking

* Improve chain positioning

* Add copy/pasting

* Move upstream nodes on shift+drag

* merge conflict fixes

* Improve Graph.svelte code quality

* Final improvements to Graph.svelte

* Fix layer panel

* Performance optimizations

* Bug fixes and derived PTZ

* Chain organization improvement and bug fixes

* Bug fixes, remove all warnings

* Automatic file upgrade

* Final code review

* Fix editor tests

* Fix compile errors

* Remove select tool intersection check when panning

* WIP: Import/Exports

* Fix JS issues

* Finish simplified import/export UI

* Import/Export viewport edge UI

* Remove minimum y bound on import/export ports

* Improve performance while panning graph

* cargo fmt

* Fix CI code build

* Format the demo artwork graph with chains

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: dennis@kobert.dev <dennis@kobert.dev>
2024-08-04 06:47:13 -07:00
Keavon Chambers 44ffb635e9
Improve rendered SVG output syntax for better compatibility and terseness (#1880)
* Improve rendered SVG output syntax for better compatibility and terseness

* Fix CI failing on boolean operations without wasm32?

* Attempt 2
2024-07-30 08:28:49 -07:00
Dennis Kobert 3657b37574
Deprecate LetNodes in favor of new scope API (#1814)
* WIP

* Start deprecating let nodes

* Replace WasmEditorApi network imports with new Scope input

* Add missing unwrap

* Add #[serde(default)] to scope_injections

* Restructure WasmEditorApi definition to be available as a TaggedValue

* Fix text node

* Use stable toolchain in nix shell again

* Code review

* FIx text node and remove all remaining warnings

* Require executor input to be 'static

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-07-10 14:18:21 +02:00
Raminder Singh 62f73df048
Fix a lot of Clippy warnings (#1808)
* fix a lot of clippy warnings

* fix more clippy warnings

* fix yet more clippy warnings

* bump msrv to 1.70.0 to silence warnings

* fix a lot of clippy warnings

* fix more clippy warnings

* fix yet more clippy warnings

* fix a few more warnings

* fix a clippy warning

* remove a commented out line

* silense too many arguments error

* fix more clippy warnings

* prefix underscore to unused vars/functions to fix warnings

* use filter instead of map

* move raw-rs-tests feature flat to module level to fix unused imports warnings

* fix a couple of unused result warnings

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-07-09 05:02:52 -07:00
James Lindsay 1652c713a6
Add nondestructive vector editing (#1676)
* Initial vector modify node

* Initial extraction of data from monitor nodes

* Migrate to point id

* Start converting to modify node

* Non destructive spline tool (tout le reste est cassé)

* Fix unconnected modify node

* Fix freehand tool

* Pen tool

* Migrate demo art

* Select points

* Fix the demo artwork

* Fix the X and Y inputs for path tool

* G1 continous toggle

* Delete points

* Fix test

* Insert point

* Improve robustness of handles

* Fix GRS shortcuts on path

* Dragging points

* Fix build

* Preserve opposing handle lengths

* Update demo art and snapping

* Fix polygon tool

* Double click end anchor

* Improve dragging

* Fix text shifting

* Select only connected verts

* Colinear alt

* Cleanup

* Fix imports

* Improve pen tool avoiding handle placement

* Improve disolve

* Remove pivot widget from Transform node properties

* Fix demo art

* Fix bugs

* Re-save demo artwork

* Code review

* Serialize hashmap as tuple vec to enable deserialize_inputs

* Fix migrate

* Add document upgrade function to editor_api.rs

* Finalize document upgrading

* Rename to the Path node

* Remove smoothing from Freehand tool

* Upgrade demo artwork

* Propertly disable raw-rs tests

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Adam <adamgerhant@gmail.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2024-07-05 13:42:40 -07:00
Tayfun Yaşar 5b6a2518e4
Fix clicking a selected anchor not deselecting all other selected points (#1782)
* possible location of the change is decided.

* fix for issue #1774
2024-06-16 04:02:09 +00:00
adamgerhant 6d74abb4de
Node network subgraph editing (#1750)
* Breadcrumb visualization, nested network consistency, create definitions for Merge internal nodes

* Add index to network inputs, remove imports usage from flatten network

* Replace NodeOutput with NodeInput::Node

* Fully remove imports field, remove unnecessary identity nodes, move Output node to encapsulating network

* Replace previous_outputs with root_node, fix adding artboard/layer to empty network

* Import/Export UI nodes

* Display input/output types dynamically from compiled network

* Add LayerNodeIdentifer::ROOT_PARENT

* Prevent .to_node() on ROOT_PARENT

* Separate NodeGraphMessage and GraphOperationMessage

* General bug fixes with nested networks

* Change layer color, various bug fixes and improvements

* Fix disconnect and set node input for proto nodes and UI export node

* Dashed line to export for previewed node

* Fix deleting proto nodes and nodes that feed into export

* Allow modifications to nodes outside of nested network

* Get network from Node Id parameter

* Change root_node to previous_root_node

* Get TaggedValue from proto node implementation type when disconnecting

* Improve preview functionality and state

* Artboard position and delete children fix

* Name inputs/outputs based on DocumentNodeDefinition or type, fix new artboard/layer insertion

* replace "Link" with "Wire", adjust previewing

* Various bug fixes and improvements

* Modify Sample and Poisson-Disk points, fix incorrect input index and deleting currently viewed node

* Open demo artwork

* Fix opening already upgraded documents and refactor FrontendGraphDataType usages

* Fix deleting within network and other bugs

* Get default node input from compiled network when copying, fix previews, tests, demo artwork

* Code cleanup

* Hide EditorApi and add a comment describing unresolved Import node input types

* Code review

* Replace placeholder ROOT_PARENT NodeId with std::u64::MAX

* Breadcrumb padding

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-06-02 08:01:56 +00:00
Keavon Chambers 0a9bd41be1
Code cleanup and refactoring to enhance consistency (#1695)
- Move message handler payload data into structs
- Organize the file structure used by `editor/src/messages/portfolio/document` `/node_graph` and `/graph_operation`
- Make derive attributes use `serde::Serialize, serde::Deserialize` consistently instead of `use serde::{Deserialize, Serialize};` imports
- Various other code cleanup and refactoring
2024-03-20 21:28:51 -07:00
Nicolás Mayora ed3f7acdd7
Fix the Path tool's point dragging getting offset when viewport is panned (#1693)
fix: moving a point with the path tool after panning

Co-authored-by: Nico Mayora <mayoranicolas0104@gmail.com>
2024-03-17 23:30:53 -07:00
Elbert Ronnie 42c822020e
Make auto-panning speed uniform (#1690)
* Make auto-panning speed uniform

* Abstract time-delta calculation to `TimeInfo`

* Update docs and add additional check

* Apply code review changes
2024-03-16 06:36:22 +00:00
Keavon Chambers 5bca931813 Rename handle mirroring to colinear 2024-03-14 07:44:55 -07:00
Elbert Ronnie ea4f3d8bba
Add auto-panning to all remaining tools (#1682)
* Add auto-panning to Gradient tool

* Add auto-panning to Path tool

* Add auto-panning to Pen tool

* Add auto-panning to Spline tool

* Add auto-panning to Line tool

* Add auto-panning to Rectangle tool

* Add auto-panning to Ellipse tool

* Add auto-panning to Polygon tool

* Hide `PointerOutsideViewport` in debug messages

* cargo fmt

* Code review cleanup

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-14 06:05:33 +00:00
milan-sedivy 9ac10cdcf8
Comprehensively polish up the input hints across all tools and states (#1670)
* Add missing keyhints to most tools

* Standardize hints further

* Improve GRS numerical display values

* Additional hints improvements

* Improve Path tool hints; add Ctrl+Shift+A point deselection

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-12 20:20:25 -07:00
milan-sedivy aa9a3e648a
Fix cancellation of drag actions in all tools where it's missing (#1664)
* Change message sent from DocumentMessage::Undo to DocumentMessage::AbortTransaction while aborting select tool

* Fix NavigationTool not aborting

* Fix NavigationTool tilt

* Make gradient tool abortable

* Make PathTool drag actions abortable

* Make FreeHand Tool abortable

* Make BrushTool abortable

* Fix filename typo

* Make artboards also abortable

* Rearrange key bindings for consistency

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-03-09 16:19:56 -08:00
Karthik Prakash 0c60fd95fa
Remove `remain` alphabetical sorting enforcement macros (#1647)
remove `remain`

Co-authored-by: 0HyperCube <78500760+0HyperCube@users.noreply.github.com>
2024-03-06 16:43:51 +00:00
Elbert Ronnie 9479abe114
Fix dropdown keyboard movement bug (#1630)
* Add a value to all `MenuListEntry`

* cargo fmt

* Make `value` as constructor in `MenuListEntry`

* Make `value` as constructor in `RadioEntryData`
2024-03-02 17:06:08 -08:00
Keavon Chambers fc8b41914b
Fix anti-aliasing in overlays by aligning everything with the pixel grid (#1603) 2024-02-13 20:47:16 -08:00
Nikita-str f25038067e
Path tool: sliding point insertion (#1581)
* #1578 sliding point works(1st approx)

TODO:
* don't move too close to the side points
* double click works incorrect?
* do we need to jump from segment to segment?

* #1578 disallow move slide point too close to side points

* fix double click + ctrl insertion

* #1578 select insertion point (except `ctrl` case)

* #1578 far depends on line width & more accurate seg finding

* #1578 insert point on most top suitable selected layer

* #1581 draw insertion point by overlay  + `Esc` abort

* #1581 sharp stay unchanged on double click

* #1581 fix incorrect handle of scaling

* #1581 `square` selection point & too close in px(instead of magic)

* #1581 bug fix: insertion point on unselection

* #1581 use `color: Option` instead of `SelectionType`

* Some code review, still need to review shape_editor.rs

* #1581 insert sharp point on a straight segment

Also correct insertion on quadratic segments

`ManipulatorGroup::have_handle` have such form because `handle = Some(self.anchor)` often used instead of `handle = None`

* Final code review pass

* Code review pass

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-02-05 08:45:25 +00:00
zhiyuan a412a77062
Support for deleting points to break path (#1593)
* feat: break closed curve

* feat: update hotkeys and handles

* feat: break an open path

* feat: elegantly handle breaking at multi points in a subpath

* feat: handle break at end points

* feat: ctrl+delete to remove segments and break path

* fix: rm unused

* First code review pass

* fix: closed eclipse handles after breaking path

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-02-04 21:02:09 -08:00
0HyperCube 456ca170a4
Layer and grid snapping systems (#1521)
* Grid overlays

* Rectangle tool basic snapping

* Fix bezier demos

* Fix bézier crate tests

* Constrained snapping for circle & shape tool

* Line tool snapping

* Pen tool snapping

* Path tool snapping

* Snapping whilst dragging layers (not constrained)

* Constrained drag

* Resize snapping

* Normal and tangent

* Cleanup

* Grid snapping

* Grid snapping

* Fix imports

* Fix bug in artboard tool

* Fix hang on 0 size grid spacing

* Fix NaN when scaling

* Polishing

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-01-13 14:32:10 +00:00
Keavon Chambers 78a1bb17cd Move selected node list from DocumentMetadata to the document (#1565) 2024-01-13 04:52:47 -08:00
Keavon Chambers aab0fcf84c
Update graph UI and improve simplicity and robustness of sending graph and layer panel updates (#1564)
* WIP

* Fix loading the structure of layers

* Fix broken indents

* Remove debugging stuff

* Fix displaying errors and node graph UI fixes/improvements

* Fix compilation failure

---------

Co-authored-by: 0hypercube <0hypercube@gmail.com>
2024-01-13 04:15:36 -08:00
Keavon Chambers 7bfe0ce55b
Retire layer paths used throughout the code (#1531)
* Part 1

* Part 2

* Part 3

* Part 4

* Part 5

* Part 6

* Part 7

* Part 8
2023-12-21 19:32:46 -08:00
Keavon Chambers 92203f3576
Remove the whole document-legacy crate (#1524)
Remove the whole document-legacy crate

Closes #1520
2023-12-20 05:45:54 -08:00
Keavon Chambers 9a7d7de8fa Remove most of document-legacy (#1519)
* Remove boolean ops and unused doc-legacy Operations

* Remove Shape legacy layers

* Remove legacy layer Properties panel code

* Remove additional unused doc-legacy Operations

* Removed unused rendering-related legacy-layer code

* Upgrade dep so CI builds

* Remove various additional unused functions and messages

* Remove the LayerData trait

* Remove RenderData struct and usages

* Banish the Operations system

* Further removals
2023-12-19 04:36:19 -08:00
0HyperCube c42d030f18 New overlay system (#1516)
* Port gradient tool overlays

* Fix tests

* Text tool

* Artboard tool and some of select tool

* Port select tool drawing box

* Pen and path tool

* Remove overlays document

* Show the overlay refactor as done on the website roadmap

* Select tool bounds in layer space (first layer)

* Code review and fixes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-12-18 11:17:43 +00:00