Commit graph

472 commits

Author SHA1 Message Date
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
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
6becaef980
Fix Vello rendering the infinite canvas without a white background color (#2361)
Fix infinite canvas for vello

Remove debugging fill

Remove debug log
2025-03-06 11:37:00 +00: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
Dennis Kobert
8d0c5d305d
Remove checks from append_subpath to improve vector editing performance (#2190)
Remove checks from append_subpath

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-03-01 11:45:49 +00:00
Keavon Chambers
390574d5c6 Limit the Sample to Points node's spacing value to prevent freezing when 0 2025-02-25 00:45:54 -08:00
Keavon Chambers
2c88bee0ee Update some UI components to polish the frontend 2025-02-21 12:58:05 -08:00
mTvare
90a8036c47
Fix self-chaining of transforms; fix compass rose getting offset when rotating a layer (#2296)
* Fix self-chaining of transforms and compass rose under single layer

1340632846
1340608972

* When not invertible transformation, do nothing

* Fix overlays and compass control when can't be visible

* Simplify selection logic in compass states

* Show compass only if it was possible that it could be seen before dragging

* Prevent resizing line objects

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-02-17 04:28:33 -08:00
Priyanshu
2d90bb0cbf
Add upgrade script to convert "Spline" node to "Path" -> "Spline from Points" (#2274)
* 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>
2025-02-12 23:45:30 +00:00
Adesh Gupta
20a5f71bda
Add Pen and Path tool modes to avoid showing all handles (#2264)
* 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>
2025-02-12 01:30:15 -08:00
Keavon Chambers
0d8b25d37f
Update most Rust dependencies (#2259) 2025-02-04 02:41:13 -08:00
mTvare
a0f8f89e71
Make the transform cage show/hide resize grips as space allows (#2209)
* Changes rotation handles to be around overlay squares

Fixes 1330785941

* Fix zero width objects not being selected by slightly nudging the transform

* Follow the categorical limits to render overlay quads

As discussed here: 1331166336

* 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>
2025-01-30 01:10:40 +00:00
James Lindsay
c5a3c32114
Fix regression causing pasted images to have a zero-size transform (#2238)
* 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>
2025-01-29 21:09:02 +00: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
James Lindsay
93880abc4c
Experimental vector meshes (#2223)
* Experimental vector meshes

* Clarify limitations in label and tooltip

* Restore old traversal direction

* Fix Bezier-rs crashes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-25 17:13:35 -08:00
Keavon Chambers
8505ed3f10
Improve older document upgrading compatibility and make node type errors clearer (#2201)
* Improve older document upgrading compatibility and make node type errors clearer

Misc.

* Fixes

* Avoid unwrap
2025-01-21 01:40:43 -08:00
Adam Gerhant
eec0ef761c
Polish user-created subgraph nodes: imports in the Properties panel; reorder/delete/rename imports/exports (#2105)
* Remove imports/exports

* WIP: Autogenerated properties

* WIP: Input based properties

* WIP: Hashmap based input overrides

* Migrate noise pattern node to input properties

* Reorder exports

* Continue migrating properties

* WIP: Improve reorder exports

* Automatically populate all input properties for sub networks

* Complete reorder import and export

* Add widget override to node macro

* Migrate assign colors to input based properties

* WIP: Full node property override

* Node based properties override for proto nodes

* Migrate all node properties to be input based

* Rename imports/exports

* improve UI

* Protonode input valid implementations

* Valid type list

* Small formatting fixes

* Polishing small issues

* Document upgrade

* fix tests

* Upgrade noise pattern node

* remove console log

* Fix upgrade script for Noise Pattern

* Improve the Properties panel representation for graphical data

* Re-export demo art

* Code review

* code review improvements

* Cleanup for node properties overrides

* Reexport demo art

* Fix clippy lints

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2025-01-20 21:13:14 -08: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
9ad6c31483
Remove blob URL dead code and clean up more frontend code (#2199) 2025-01-14 13:08:47 -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
9eb544df74 Rename "options/top bar" terminology to "control bar" and update comments 2025-01-07 17:33:45 -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
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
Keavon Chambers
b81f48385a Fix several bugged vector-related nodes 2024-12-26 16:36:45 -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
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
James Lindsay
99ac7238fc
Fix bitmap bounding box (#2122) 2024-12-04 21:28:40 +00:00
James Lindsay
e3bb11ec1b
Fix clippy lints (#2119) 2024-11-29 22:58:49 +00: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
James Lindsay
320d030c08
Fix the spline node algorithm to be continuous across start/end points (#2092)
* Simplify spline node implementation using stroke_bezier_paths

* Improve closed splines

* Code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-11-07 00:46:45 -08:00
James Lindsay
c3b526a46f
Fix Bevel node crash with zero-length segments (#2096)
Fix bevel with zero length segment
2024-11-07 00:08:09 -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
7d86bf4abf New node: Jitter Points 2024-11-02 16:37:27 -07:00
Keavon Chambers
4c9ab2d50b
New nodes: "Clamp", "To U32", and "To U64" (#2087)
* New nodes: "Clamp", "To U32", and "To U64"

* Add name
2024-11-02 03:20:02 -07:00
Keavon Chambers
3f17e83e80
Improve Sample Points, Scatter Points, and Splines from Points to include segments and work with subpaths (#2085) 2024-11-01 12:44:05 -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
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
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
James Lindsay
dae6b2f239
New node: Bevel (#2067)
* Bevel node

* Fix clippy lints

* Prevent negative values

* Rename flipped() -> reversed()

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-25 19:25:41 -07:00
James Lindsay
7fc0a593c8
Fix gradient render transforms with Vello (#2059)
Fix vello gradient transform
2024-10-26 00:12:24 +00:00
adamgerhant
fd20d51e85
Fix various crashes and bugs (#2075)
* Fix offset brush tool

* Fixes
2024-10-25 16:54:37 -07:00
Dennis Kobert
3e0178a032
Add switch node and fix log to console node (#2064)
* Add switch node and fix log to console node

* Formatting

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2024-10-25 16:30:02 -07:00