Commit graph

842 commits

Author SHA1 Message Date
Keavon Chambers
feba87449b Add more actions to the Layer menu bar entries 2024-12-26 16:31:13 -08:00
0SlowPoke0
a6676e4abd
Fix Select tool's box selection not being able to extend a selection with shift (#2157)
* select parent-node,remove deselect all layers message

* Comment nits

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-24 23:10:43 -08: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
Utsav Singh
a1dc9556af
Improve quick measurement overlays across all possible arrangement scenarios (#2147)
* setup single edge crossing handling for quick measure tool

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects.

* setup single edge crossing handling for quick measure tool

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects.

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects.

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects.

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects. Add a dashed_line_with_pattern function that gives more granular control over dash_width and gap_width.

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects. Add a dashed_line_with_pattern function that gives more granular control over dash_width and gap_width.

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects. Add a dashed_line_with_pattern function that gives more granular control over dash_width and gap_width.

* Setup quick measure functionality for intersecting objects and handle centerline cases for non intersecting objects. Add a dashed_line_with_pattern function that gives more granular control over dash_width and gap_width.

* Nit picks

* Define wrapper for Overlay_context line method

* Comments and consolidating lines of code

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-22 19:20:03 -08:00
Utsav Singh
bc47d06139
Fix transform cage rotation abort causing broken state upon next transformation (#2149)
Fix abort functionality on Right Click when performing transformations using select tool
2024-12-22 01:54:30 -08:00
James Ryans
3be7505faf
Automatically place layers into the artboard they're drawn inside of (#2110)
* place new layer from basic tools within an artboard bounds

Signed-off-by: James Ryans <james.ryans2012@gmail.com>

* add for Text Tool

Signed-off-by: James Ryans <james.ryans2012@gmail.com>

* use click_xray function

Signed-off-by: James Ryans <james.ryans2012@gmail.com>

* support for freehand tool

Signed-off-by: James Ryans <james.ryans2012@gmail.com>

* support spline tool

Signed-off-by: James Ryans <james.ryans2012@gmail.com>

---------

Signed-off-by: James Ryans <james.ryans2012@gmail.com>
2024-12-20 19:02:00 -08:00
Ayush Chauhan
337b8bad13
Improve issues with selection history (#2138)
* Selection history when creating a new layer

* fixed selection history

* cleaned up the code, removed duplicate network_metadata calls

* re: fixed selection history
Added a default value for selection_undo_history to make sure its never actually empty.
2024-12-20 13:56:33 -08:00
Keavon Chambers
ed119ad3d7 Add Freehand tool drawing new subpaths on an existing layer with Shift held 2024-12-17 22:01:42 -08:00
Jacin Yan
3423c8ec13
New node: Math (#2121)
* 2115 IP

* Initial implementation of Expression node

* Register Expression Node

* Add Expression DocumentNode Definition

* DocumentNodeImplementation::Expresssion in guess_type_from_node

* Move expression.rs to graphene-core

* WIP: Investigating 'exposed' & 'value_source' params for Expression property

* Node graph render debug IP

* Single input can change node properties; complex debug IP

* Fix epsilon in test

* Handle invalid expressions in expression_node by returning 0.0

* Run cargo fmt

* Set the default expression to "1 + 1"

* Hardcode the A and B inputs at Keavon's request

* Rename and clean up UX

* Move into ops.rs

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-17 07:08:14 +00:00
Keavon Chambers
1264ea8246 Tidy up the UI with clearer Layers panel selection marks and removal of most "coming soon" UI elements 2024-12-14 20:49:21 -08:00
James Lindsay
fc0cf604df
Update some dependencies (#2134)
* Update some dependencies

* Update to action v2

* Fix for v2
2024-12-12 18:28:49 +00:00
0SlowPoke0
d97b02506e
Fixes shortcut key not showed in File->Close (#2135)
removed_the_dead_code_from_the_commit
2024-12-07 18:06:16 +00:00
James Lindsay
b21b1cbfc7
Simplify the implementation of the message buffering (#2123)
* Simplify the implementation of the message buffering

* Add assert to ensure list is empty
2024-12-02 20:48:33 +00:00
James Lindsay
e3bb11ec1b
Fix clippy lints (#2119) 2024-11-29 22:58:49 +00:00
0SlowPoke0
00629571f2
Disabling colinear state when both the handles are selected and moved (#2120)
* disable collinear state

* Add comment

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
2024-11-29 22:58:28 +00:00
Pratik Agrawal
2cf33e45bd
Remove Double-Click Behavior for Switching to Path Tool on Non-Path Layers (#2116)
* Remove double-click behavior for switching to Path tool on non-Path layers

* removed the else-if block

* removed the path tool activation from shallowm mode

---------

Co-authored-by: Pratik Agrawal <patrik@Pratiks-MacBook-Air.local>
2024-11-26 16:33:14 +00:00
James Lindsay
51ce51ea8c
Refactor collection of snap targets (#2114)
* Collect snap targets cleanup

* Make Clippy happy

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-20 22:27:49 -08:00
Keavon Chambers
99cf8f0c4f Clean up editor preferences dialog 2024-11-15 18:47:50 -08:00
Adam Gerhant
4250f291ab
Add merging nodes into a subgraph with Ctrl+M and basic subgraph signature customization (#2097)
* Merge nodes

* Fix bugs/crashes

* WIP: Debugging

* Fix bugs, add button

* Add imports/exports

* Improve button

* Fix breadcrumbs

* Fix lints and change shortcut key

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-12 14:27:42 -08:00
Keavon Chambers
4c4d559d97 Fix crash when upgrading a document with a Modulo node from 3 commits ago 2024-11-12 13:55:03 -08:00
James Ryans
ee2d4a03db
Make Pen tool always snap to endpoint anchors, even when snapping is off (#2107)
* pen should always snap on last anchor

Signed-off-by: James Ryans <james.ryans2012@gmail.com>

* snap anchor on every single connected points

Signed-off-by: James Ryans <james.ryans2012@gmail.com>

---------

Signed-off-by: James Ryans <james.ryans2012@gmail.com>
2024-11-12 13:53:55 -08:00
James Lindsay
3ce1317053
Make the Pen tool only append new paths when Shift is held (#2102)
* Append to a path with shift

* Fixup transforms

* Revert unnecessary transform change

* Fix delete node button transaction

* Prevent artboard from being selected after making a new document

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-11 15:14:32 -08:00
Keavon Chambers
d649052255 Upgrade and document the math operation nodes 2024-11-09 23:23:25 -08:00
Keavon Chambers
de366f9514 Add Brush tool warning; move font list loading to document creation time 2024-11-09 12:27:09 -08:00
Keavon Chambers
457619794b
Improve nudging when tilted and add Artboard tool nudge resizing; disable menu bar entries when no layer is selected (#2098)
* Make nudging follow a tilted viewport

* Add artboard nudge resizing
2024-11-08 16:16:20 -08: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
Keavon Chambers
f1b0d8fa87
Improve the node graph with revamped top bar and disabling tools when graph is open (#2093)
* Add "Fade Artwork" slider and disable tools when graph is open

* Add navigation and layer/node management buttons to graph top bar

* Reduce code duplication
2024-11-04 20:41:53 +00:00
Keavon Chambers
12ca06035c Hide the left border notch in layers when a wire isn't entering from the layer's left 2024-11-03 15:33:29 -08:00
Dennis Kobert
35f7cfac80
Parse description from node doc comments (#2089)
* Parse description from node doc comments

* Add node description tooltips

* Code review

---------

Co-authored-by: Adam G <adamgerhant@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-03 14:57:20 -08:00
Keavon Chambers
8d3da83606 Avoid sometimes breaking the selected layer upon switching away from the Select tool 2024-11-02 18:55:57 -07:00
adamgerhant
c7b08246c2
Allow the Pen tool to connect layers by their endpoints, merging into a single layer (#2076)
* Merge vector data layers

* Fix early return

* Fix layer space multiplication error

* Recalculate positions when changing layer space

* Add transform node

* Remove pen tool layer state
2024-11-01 12:19:46 -07: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
James Lindsay
c27d8dc5dc
Fix layer name text input (#2081) 2024-10-26 13:25:51 -07:00
adamgerhant
ff8fec6eca
Allow the Path tool to edit an upstream path even if there's a type conversion midway (#2055)
Remove type check when iterating upstream

Convert to doc comment
2024-10-26 18:39:48 +00: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
James Lindsay
5aa6716910
Add a node insertion button and layer renaming from the Properties panel (#2072)
* Add node button

* Improve css a bit

* Add layer renaming to the Properties panel and move New Layer to that, plus add unpinning to properties sections

* Add tooltip

* Re-add layer itself in listing

* Final code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-25 23:58:34 -07:00
Mohamed Osama
3c839ffd2b
Clean up old usages of NodeId(generate_uuid()) by replacing it with NodeId::new() (#2009)
Replace all `NodeId(generate_uuid())` with `NodeId::new()`
2024-10-25 19:43:46 -07:00
RyanRothweiler
63d44f22e3
Fix Text tool clearing text when hitting Escape by changing it to commit the edit instead (#2052)
* Text tool escape sends commit message

* Improve hint text

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-25 18:12:54 -07:00
James Lindsay
79408fc0cc
Fix alignment snapping not preserving aspect ratio when Shift is held (#2062)
Fix align with a diagonal constraint
2024-10-25 17:34:23 -07:00
adamgerhant
fd20d51e85
Fix various crashes and bugs (#2075)
* Fix offset brush tool

* Fixes
2024-10-25 16:54:37 -07:00
adamgerhant
6b1356fe13
Allow multiple top output wires to come from layers (#2049)
* Allow multiple outputs from layer

* Stable Ids for Flatten Vector Elements

* Clippy
2024-10-25 22:32:31 +00:00
James Lindsay
9f7b3936f4
Fix brush tool broken by #2011 (#2045)
Brush tool fix
2024-10-16 20:04:33 +00:00
adamgerhant
e09f5ecaec
Make Copy to Points and (Circular) Repeat and nodes output group data, and add flattening nodes (#2011)
* Output group from repeat, add flatten vector elements

* Fix tests

* Fix demo artwork

* Output group from copy to points, add repeat for graphic groups, fix editor freeze on render fail

* Restore painted dreams

* WIP: Fix demo artwork

* Fix demo artwork, add ungroup node

* Incorrect scaling

* fix test

* Fix demo art

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-14 12:39:28 -07:00
James Lindsay
b028bbb8cc
Fix crash from empty document with no artboards introduced in #2028 (#2036)
* Fix me crashing the editor due to not paying attention

* Swap two lines for consistency

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-14 18:24:51 +00:00
James Lindsay
a761e7803e
Improve text overlay styling and fix artboard label positioning bug (#2032)
* Improve text overlays

* I can't test code
2024-10-13 21:35:50 +00:00
fiveeyy
5c98378c7a
Fix Ctrl+H layer hiding and Ctrl+L layer locking only working with the graph open (#2029)
* Add DocumentMessage::ToggleSelectedVisibility

* Add DocumentMessage::ToggleSelectedLocked

* Update editor/src/messages/input_mapper/input_mappings.rs

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-13 14:19:46 -07:00
James Lindsay
d6f46f73da
Factor in artboard clipping to the click target x-ray function (#2028)
* Add clipping to the click xray function

* Clip area rays as well

* Code review nits

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-12 23:38:17 +00:00
James Lindsay
3b0e9587eb
Update Wasm dependencies to fix WebGPU spec change crash in Firefox with Vello (#2027)
* Update wasm deps

* Bump wasm-bindgen and fix the depricated methods
2024-10-12 14:28:39 -07:00
Keavon Chambers
f7d83d2632
New node: Offset Path (#2030)
* New node: Offset Path

* Fix CI
2024-10-11 14:50:54 -07:00
Keavon Chambers
7a56af01ef Fix the Scatter Points node 2024-10-10 13:45:51 -07:00