Commit graph

1853 commits

Author SHA1 Message Date
Priyanshu
bf6ffbddeb Bezier-rs: Add method to check subpath insideness (#2183)
* 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>
2025-01-10 00:37:40 -08:00
Keavon Chambers
51d1c4eeac Fix drawing new layers not being put next to nested selected layers
A regression introduced in #2110
2025-01-09 20:37:49 -08:00
Keavon Chambers
07601a5c6c Improve snapping with better snap target names, tooltips, cleaner overlay labels, code cleanup 2025-01-09 19:03:14 -08:00
Keavon Chambers
ae2637e08e More website loading speed and code improvements 2025-01-08 20:49:42 -08:00
Keavon Chambers
68e6bec9b5 Reduce website loading times and related code cleanup 2025-01-08 18:29:54 -08:00
Keavon Chambers
93a60daa24 Comprehensively update user manual and contributor guide, add Adam to core team 2025-01-08 03:52:11 -08:00
Keavon Chambers
9eb544df74 Rename "options/top bar" terminology to "control bar" and update comments 2025-01-07 17:33:45 -08:00
Keavon Chambers
1c880daea2 Fix isometric dotted grid and avoid antialiasing on dashed line overlays 2025-01-07 17:27:35 -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
Sidharth-Singh10
f225756655
Fix text layer getting deselected after clicking out of Text tool interactive editing (#2144)
* properties panel remains active when user edits text layer

* Keep text layers selected after editing

* Update editor/src/messages/portfolio/document/document_message_handler.rs

* Delete Empty Text Layer on Escape or Right Click

* Fix: delete empty text layer on right click

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-31 14:28:56 -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
Pratik Agrawal
606be8a74b
Make the Artboard tool shift its contents if resizing from the top/left so artwork is stationary (#2166)
* added fetch child layerfunction

* Simplify

---------

Co-authored-by: Pratik Agrawal <patrik@Pratiks-MacBook-Air.local>
Co-authored-by: hypercube <0hypercube@gmail.com>
2024-12-31 18:52:05 +00:00
Keavon Chambers
54926d5474 We reached 10k stars on GitHub! 2024-12-31 10:14:33 -08:00
Keavon Chambers
740fcb73cc Remove the hexagon shape from the above-the-fold part of the website homepage 2024-12-30 20:26:05 -08:00
Keavon Chambers
ce0cd39c9b
Update the readme 2024-12-30 03:17:39 -08:00
Nitish Choudhary
2293da7d98
Improve Text tool click targets on text layers to use the text box (#2145)
* Fix text selection

* Remove old implementation

* minor change

* Use inbuilt function instead of helper

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-28 22:11:27 +00:00
Dennis Kobert
1639a2afba
Parse doc comments on node parameters (#2163)
Parse doc comments from node arguments

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-28 12:15:49 +00:00
0SlowPoke0
6c3c2e8529
Add selection removal to the Select tool's box select (Ctrl+Shift modifier) (#2162)
* select parent-node,remove deselect all layers message

* Comment nits

* implement negative selection box

* moved comment and formatting

* Apply suggestions from code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-28 11:43:29 +00:00
Utsav Singh
6d737f15ee
Improve quick measurement overlays with better number alignment and decimal rounding (#2155)
* Tidy up number text alignment and decimal precision for quick measurement overlays

* Tidy up number text alignment and decimal precision for quick measurement overlays

* Tidy up number text alignment and decimal precision for quick measurement overlays

* Tidy up number text alignment and decimal precision for quick measurement overlays

* Tidy up number text alignment and decimal precision for quick measurement overlays

* Tidy up number text alignment and decimal precision for quick measurement overlays

* Tidy up number text alignment and decimal precision for quick measurement overlays

* Tidy up number text alignment and decimal precision for quick measurement overlays

* Formatting changes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-12-28 00:45:26 -08:00
Keavon Chambers
b81f48385a Fix several bugged vector-related nodes 2024-12-26 16:36:45 -08:00
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
Gulshan1-3
79b4f4df7b
Add dot product node (#2126)
* dot product node

* dot product node

* cross product node

* formatting n deleted comments

* name changed

* name changed

* cross product removed

* Minor code style changes

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
2024-12-16 20:17:51 +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
Paul Fornage
287ef26f64
Fix SVG viewBox capitalization in renderer (#2131)
fix `viewBox` capitalization
2024-12-12 20:42:41 +00: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
99ac7238fc
Fix bitmap bounding box (#2122) 2024-12-04 21:28:40 +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
urisinger
9fb494764c
Add math-parser library (#2033)
* start of parser

* ops forgot

* reorder files and work on executer

* start of parser

* ops forgot

* reorder files and work on executer

* Cleanup and fix tests

* Integrate into the editor

* added unit checking at parse time

* fix tests

* fix issues

* fix editor intergration

* update pest grammer to support units

* units should be working, need to set up tests to know

* make unit type store exponants as i32

* remove scale, insted just multiply the literal by the scale

* unit now contains empty unit,remove options

* add more tests and implement almost all unary operators

* add evaluation context and variables

* function calling, api might be refined later

* add constants, change function call to not be as built into the parser
and add tests

* add function definitions

* remove meval

* remove raw-rs from workspace

* add support for numberless units

* fix unit handleing logic, add some "unit" tests(haha)

* make it so units cant do implcit mul with idents

* add bench and better tests

* fix editor api

* remove old test

* change hashmap context to use deref

* change constants to use hashmap instad of function

---------

Co-authored-by: hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-21 10:24:01 -08: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
d7a271f675 Update the website roadmap and other details 2024-11-20 10:31:25 -08:00
Sidharth-Singh10
3b503ccde2
Bezier-rs: Make rectangle constructor produce linear segments (#2109)
* fix(bezier-rs): new_rect constructor create linear segments

* refactor
2024-11-18 21:10:08 +00: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