Commit Graph

891 Commits

Author SHA1 Message Date
Adam Jahn 4797aed05b Add 'View > Zoom to Selected' action (#1047)
* implements pan/zoom to the selected layer(s) on Period

Relates to #989

* adds layer menu support: Layer -> Center View on Selection

* relocate Center View on Selection to View -> Zoom to selected

* use the proper menu title
2023-02-20 20:00:07 -05:00
Linda Zheng 37775eb9e9 Bezier-rs: Add bounding box, extrema, and inflection functions for subpath (#953)
* Create bbox function for subpath

* Create extrema and inflection function for subpath

* Address comments

* Prevent selecting text in SVG demo boxes

* Address Keavon's comments

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-20 13:40:38 -05:00
isiko 4bb4e2c22e Add Minimum and Maximum option to Threshold node (#1029)
This might be usefull later when spliting Images into Seperate Images for each Channel, as then the other modes might behave weirdly

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-20 08:39:09 +01:00
0HyperCube 6caed9e761 Fix default value for the Output node (#1042)
* Fix default value for output node

* Don't set frame transform to zero

* Fix typo in hash function

* Clear frame on empty image

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-20 07:32:49 +00:00
Christopher Mendoza b7f2163998 Selecting an individual anchor point deselects each of the other points (#963)
* Selecting an individual anchor point deselects each of the other points

* git gra

* Selecting intersecting shapes,selects top shape

* Merge commit

* cargo fmt

* fixed: can't drag multiple selected shapes.

* Merge commit

* Merge commit

* Code review tweaks

* Merge commit

* Fixed topmost layer and previous_mouse_position

* Fixed issues when clicking on anchors

* Works

* Function name change

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2023-02-19 23:26:02 -08:00
Keavon Chambers 964cf6df15 Fix Svelte regressions related to some input widgets 2023-02-19 22:57:11 -08:00
Dennis Kobert a993938d80 Add type checking for parameter inputs (#1045) 2023-02-20 01:37:13 +01:00
Hannah Li 98f172414a Bezier-rs: Add iframes to rustdoc (#1036)
* Add iframes examples

* Move TValue selection to bottom

* Remove spaces

* Add background, adjust heights

* Minor lint fix
2023-02-17 19:09:36 -05:00
Rob Nadal 9a52cae9b9 Bezier-rs: Add SubpathTValue and euclidean parameterization for subpaths (#1027)
* Added SubpathTValue and euclidean parameterization for subpaths

* Small fix

* Added bounds checking to get_segment

* Code review

* code review nit for clarity

---------

Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-17 15:33:52 -05:00
isiko 344f243432 Fix Levels node gamma correction (#1034)
* Fix Levels Node

* Fix the fix

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-16 18:33:03 +01:00
Dennis Kobert 63b9b670a1 Change tauri build directory back to `../dist` (#1033) 2023-02-16 15:43:21 +01:00
Dennis Kobert 3015a9c8af Chain cache node and Clone to make them usable from the ui (#1032)
Chain cache node and Clone to make it a drop in replacement
2023-02-16 15:03:13 +01:00
Dennis Kobert e6a8d5c573 Add input caching to old blur implementation (#1018) 2023-02-16 15:00:08 +01:00
Dennis Kobert 761cec54ef Hash a type based on its name because the id could be empty (#1031) 2023-02-16 09:27:47 +01:00
isiko 7071aabba8 Add Levels adjustment node (#1028)
* Add Levels Node

* Fix naming and algorithm

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-16 01:11:31 +01:00
Dennis Kobert 5dab7de68d Add type checking to the node graph (#1025)
* Implement type inference

Add type hints to node trait

Add type annotation infrastructure

Refactor type ascription infrastructure

Run cargo fix

Insert infer types stub

Remove types from node identifier

* Implement covariance

* Disable rejection of generic inputs + parameters

* Fix lints

* Extend type checking to cover Network inputs

* Implement generic specialization

* Relax covariance rules

* Fix type annotations for TypErasedComposeNode

* Fix type checking errors

* Keep connection information during node resolution
* Fix TypeDescriptor PartialEq implementation

* Apply review suggestions

* Add documentation to type inference

* Add Imaginate node to document node types

* Fix whitespace in macros

* Add types to imaginate node

* Fix type declaration for imaginate node + add console logging

* Use fully qualified type names as fallback during comparison

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-15 23:31:30 +01:00
Rob Nadal a64c856ec4 Bezier-rs: Updated Bezier function signatures to accept TValue (#967)
* Create helper for converting d to t values

* Add euclidean option for tangent and normal

* Modified bezier functions signatures to accept ComputeType

* Stylistic changes per review

* Added ComputeType documentation

* Renamed ComputeType to TValue

* Fixed comments

* Fixed failing unit tests

* Code review

* Fix comments in code review

* Renamed compute_type_to_parametric to t_value_to_parametric

---------

Co-authored-by: Linda Zheng <thelindazheng@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-13 12:31:51 -05:00
Keavon Chambers f0ad4c91d3 Replace "Edit" icon with final version 2023-02-12 20:02:15 -08:00
Keavon Chambers 33b5c0f5f4 Svelte: Fix FontInput component infinite loop 2023-02-12 01:01:40 -08:00
locriacyber 717e9c861a Svelte: Fix part of MenuBarInput (#982)
Fix MenuBarInput

Fix menubar - remove dead code

Amend minor code style
2023-02-11 22:38:34 +00:00
Keavon Chambers 91f5f74d58 Update release series to Alpha Milestone 2 2023-02-11 12:00:00 -08:00
0HyperCube 1b0e1b9bdf Update Imaginate to output bitmap data to the graph via Image Frame node (#1001)
* Multiple node outputs

* Add new nodes

* gcore use std by default to allow for testing

* Allow multiple node outputs

* Multiple outputs to frontend

* Add ImageFrameNode to node registry

* Minor cleanup

* Basic transform implementation

* Add some logging to image encoding

* Fix ImageFrameNode

* Add transform input to Imaginate node (#1014)

* Add transform input to imaginate node

* Force the resolution to be edited with no transform

* Add transform to imaginate generation

* Fix compilation

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add labels to node outputs

* Fix seed; disable mask when transform is disconnected; add Imaginate tooltips

* Rename 'Input Multiple' node to 'Input'

* Code review

* Replicate to Svelte

* Show only the primary input chain in the Properties panel

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-11 08:56:31 +00:00
isiko a709a772d5 Add color weights to Grayscale node and improve luminance handling (#1015)
* Add weighted grayscale node

* Rename nodes, fix grayscale weighting, add luma calc options

* Fix tests

* Add Tint Option

* Improve (but not full fix) tint

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-10 21:55:01 +01:00
Keavon Chambers d456640bb8 Fix regressions in previous PR 2023-02-09 11:53:14 -08:00
locriacyber bf21cbf3ce Fix text overflow in text/radio buttons (#1004)
* [frontend] Clip button text, show ellipsis on overflow

* Fix CSS rules, replicate to Vue

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-09 09:16:54 +00:00
Hannah Li ff51098c11 Bezier-rs: Add hash URLs for individual API examples (#968)
* Handle displaying single demos

* Address comments

* Update eslintrc

* Add hash links

* Use hash instead of pathname

* Address small nits

* Change url format

* CSS improvements

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-08 23:32:28 -05:00
Keavon Chambers 875f2a5cd1 Improve Threshold node, move Gamma into Exposure node 2023-02-08 17:48:08 -08:00
Dennis Kobert 8e3480e952 Image adjustment nodes restructure (#1013)
* Add macro for creation of Map image nodes

* Move nodes to adjustments module

* Add Saturation and Lightness to hue shift node

* Fix raster node macro

* Add Threshold Node

* Convert all adjustment nodes to new format

* Start implementing vibrance node

* Remove package-lock.json

* Code review

---------

Co-authored-by: isiko404 <isihd.ko@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-09 01:17:09 +01:00
Keavon Chambers 202b0ee6ed Remove Color struct from document-legacy (#1012) 2023-02-07 17:31:50 -08:00
Dennis Kobert 5462bf5f2f Use cargo nextest and sccache in ci (#1011)
* Use cargo nextest

* add sccache
2023-02-08 00:15:41 +01:00
Dennis Kobert 620540d7cd Incremental compilation and stable node IDs (#977)
* Generate stable node ids

* checkpoint

* Implement borrow tree

* Add eval function on borrow tree

* Refactor Node trait to fix lifetime issues

* Compiler infinite loop

* Impl compose pair

* Transition to double lifetime on trait

* Change node trait to use a generic arg for the input

* Start adapting node_macro

* Migrate more nodes to new macro

* Fix raster tests

* Port vector nodes

* Make Node trait object safe

* Fix FlatMapResultNode

* Translate most of gstd

* Fix DowncastBothNode

* Refactor node trait once again to allow for HRTB for type erased nodes

* Start working on type erased nodes

* Try getting DowncastBothNode to work

* Introduce Upcasting node + work on BorrowTree

* Make enough 'static to get the code to compile

* Transition DynamicExecutor to use borrow tree

* Make Compose Node use HRTB's

* Fix MapResultNode

* Disable blur test

* Add workaround for Composing type erased nodes

* Convert more nodes in the node_registry

* Convert more of the node_registry

* Add update tree fn and hook up to frontend

* Fix blur node

* Implement CacheNode

* Make frontend use graph compiler

* Fix document_node_types type declaration for most nodes

* Remove unused imports

* Move comment down

* Reuse nodes via borrow tree

* Deprecate trait based value in favor of TaggedValue

* Remove unsafe code in buffer creation

* Fix blur node

* Fix stable node id generation

* Fix types for Image adjustment document nodes

* Fix Imaginate Node

* Remove unused imports

* Remove log

* Fix off by one error

* Remove macro generated imaginate node entry

* Create parameterized add node

* Fix test case

* Remove link from layer_panel.rs

* Fix formatting
2023-02-07 20:06:24 +01:00
Sahra Zhou 77e69f4e5b Add scaling by nudging with the Alt key (#990)
* update current progress working on issue#930

* Issue#930: features other than local scaling implemented

* runs cargo fmt

* issue930: implemented features(local scaling disregraded) update: merged master branch and solved coflicts

* combined scaling and nudge feature

* combined scaling and nudge feature

* resolved issues when trying to scale below 1. pixel and other comments

* reduce code complexity

* reduce complexity

* Improve code readability/idiomaticness

* Add hints

---------

Co-authored-by: Shiro <shiro@damedane.local>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-07 01:14:50 -08:00
Keavon Chambers 97b461377f Fix error spam from Rust-Analyzer due to build scripts 2023-02-03 13:00:55 -08:00
Shouvik Ghosh 316df70571 Edit selected text layer by hitting Enter (#1000)
* Allow text editing when pressing Enter on a single selected text layer

* Updated LayerDataType import

* Extract the logic to set the edit layer into a function

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-31 22:49:50 +05:30
Hannah Li a328e7d3ef Bezier-rs: Add split for Subpath (#988)
* Add subpath split

* Update comment and colors

* Address comments

* Improve visualization clarity

* Code review

---------

Co-authored-by: Rob Nadal <Robnadal44@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-31 03:17:20 -05:00
Jackie Chen 511a8aa164 Bezier-rs: Add normal and tangent to subpath (#1003)
tangent and normal for subpath

Co-authored-by: Rob Nadal <Robnadal44@gmail.com>
2023-01-31 00:15:37 -05:00
Keavon Chambers beab0f01c6 Refactor font_cache into render_data; delete image layer type 2023-01-29 20:31:14 -08:00
Keavon Chambers 7ab601c0c6 Clean up arg order in process_message() so data is last 2023-01-29 04:07:41 -08:00
Keavon Chambers d990110f63 Apply lints and cleanup to Rust code 2023-01-29 03:01:57 -08:00
Brendan Allan 5388b59e97 Groundwork for integrating Specta (#949)
* add derive(specta::Type)

* use specta from git

* introduce Uuid type

* remove unnecessary specta::Type

* document export_types test

* upgrade Specta
The previous Specta branch had some hacks that were just for this project. They have all been converted into proper features so they can be merged into main.

* remove some unnecessary specta::Type uses

* add MessageDiscriminantDef explanation

* manually export types with specta

* rename 'specta.rs' to 'export_types.rs'

* rename 'export_types' to 'generate_ts_types'

---------

Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me>
2023-01-28 22:29:38 -08:00
kadir e0146d57f7 Update UI when deleting last point of shape with Path tool (#979)
* Added new DocumentResponse variant

* Update Operation::DeleteSelectedManipulatorPoints to update Layer Tree by delegating deletion to Operation::DeleteLayer. Also emits Operation::DeletedSelectedManipulatorPoints to let editor clear Properties panel

* Update process_message() to deal with new DocumentResponse::DeletedSelectedManipulatorPoints match case. When this DocumentResponse is emitted, it clears the Properties panel.

* Added Display trait implementation for DocumentResponse::DeletedSelectedManipulatorPoints. Updated imports in document_message_handler.rs to get the correct types for messages emitted from DocumentResponse::DeletedSelectedManipulatorPoints match case in process_message().

* Removed useless import. Capitalized comments for style consistency.

* Updated messages emitted to clear Properties panel by emitting LayoutMessage::SendLayout's instead, which update the backend widget state

* Revert inclusion of unused imports

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-28 18:32:31 -05:00
kadir 6676f16ea8 Auto switch to Select tool after importing an image (#994)
Forced user tool to be Select Tool after importing image.

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-28 05:35:02 -05:00
0HyperCube 0a03aec343 Reduce tool code duplication and boilerplate (#993)
* Reduce tool code duplication

* Add doc comments

* Fix Mac key variant, which can't be auto-converted without false positives

* Rename "key" to "keys"

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-28 08:38:52 +00:00
Dennis Kobert 0531df18d5 Implement blur as a document node (#987)
* Implement blur as a document node

* Reuse node node registry

* Add comment explaining the use of once cell

* Fix rebase error
2023-01-27 21:47:47 +01:00
0HyperCube 898b0bb582 Cull snapping of points outside viewport (#961)
Do not snap to points outside viewport

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-27 20:28:12 +00:00
0HyperCube 64e62699fc Replace the image layer type with an Image node (#948)
* Use builder pattern for widgets

* Arguments to new function

* Add node graph when dragging in image

* Fix duplicate import

* Skip processing under node graph frame if unused

* Reduce node graph rerenders

* DUPLICATE ALL frontend changes into other frontend

* DUPLICATE more changes to another frontend

* Code review

* Allow importing SVG files as bitmaps

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-27 10:01:09 +00:00
Keavon Chambers 66e8325362 Update project readme and MSRV 2023-01-24 01:33:30 -08:00
0HyperCube 5cbe3f7573 Artboard history (#976)
* Convert DocumentSave to struct

* Comit the artboard history save in some cases

* Cause index out of bounds error

* Use box to avoid weird wasm error

* Implement the artboard history

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-22 19:51:08 +00:00
Keavon Chambers d2219cec36 Fix website RSS feed title 2023-01-22 00:59:26 -08:00
Keavon Chambers 05425e39ec Svelte: fix pre-init error check and Properties panel 2023-01-18 22:55:39 -08:00