Commit Graph

663 Commits

Author SHA1 Message Date
Keavon Chambers
44eb83c9b3 Fix logic bug in key internationalization for A-Z keys in alternate layouts 2022-08-14 13:57:01 -07:00
Hannah Li
3bec948cb8 Add further Bezier library unit tests (#729)
* Initial tests

* Write unit tests for Bezier

Co-authored-by: Thomas Cheng <Androxium@users.noreply.github.com>
Co-authored-by: Rob Nadal <RobNadal@users.noreply.github.com>
Co-authored-by: Linda Zheng <linda-zheng@users.noreply.github.com>
Co-authored-by: Jackie Chen <jackiechen73@users.noreply.github.com>

* Write final tests and add PartialEq and Debug traits to Bezier

* Minor changes

* Identify missing tests and rename tests

* Add tests for rotate and translate

* Add tests for bounding box and inflection

* de casteljau point test

* curvature tests

* Add more sections to the rotate and translation tests

Co-authored-by: Thomas Cheng <Androxium@users.noreply.github.com>
Co-authored-by: Rob Nadal <RobNadal@users.noreply.github.com>
Co-authored-by: Linda Zheng <linda-zheng@users.noreply.github.com>
Co-authored-by: Jackie Chen <jackiechen73@users.noreply.github.com>
Co-authored-by: Jackie Chen <jackie.chen73@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-08-14 13:56:43 -07:00
Keavon Chambers
776992a297 Simplify platform-specific keyboard layouts with Accel key and global platform variable (#748)
* Simplify platform-specific keyboard layouts with Accel key and global platform variable


Co-authored-by: Dennis <dennis@kobert.dev>
2022-08-13 13:28:02 +02:00
Keavon Chambers
d8ae727ea9 Rename MovementMessage to NavigationMessage 2022-08-11 17:20:10 -07:00
Keavon Chambers
dfdfd8149c Switch Vec<Key> to KeysGroup newtype 2022-08-11 16:35:04 -07:00
Keavon Chambers
d6e726f99d Fix shortcut label on welcome screen: "Control" -> "Ctrl" 2022-08-11 10:53:03 -07:00
Keavon Chambers
0f6ecefb3f Revamp key/code input processing which fixes Option key on Mac and other locales
Closes #742
Closes #746
2022-08-11 02:53:46 -07:00
Keavon Chambers
9f4a241e0f Extend welcome screen button click area to labels
Closes #738
2022-08-08 01:29:23 -07:00
Keavon Chambers
e440fba4cc Populate menu bar
Closes #531
2022-08-06 18:08:39 -07:00
Thomas Cheng
b2ddeea954 Implement arcs for Bezier math library (#731)
* added arcs impl

Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Rob Nadal <RobNadal@users.noreply.github.com>

* fixed arc drawing,  todo - fix linear check

Co-authored-by: Hannah Li <hannahli2010@gmail.com>

* fixed linear bug + added comments and tests

Co-authored-by: Hannah Li <hannahli2010@gmail.com>

* added max iteration guard + made params optional  + added impl todo

* Add functionality to get arcs between extrema

* Add ArcsOptions to manage optional parameters of the arcs function

* added slider to toggle between arcs impl

Co-authored-by: Rob Nadal <RobNadal@users.noreply.github.com>

* Remove unused types

* address some comments

* added rustdoc for CircularArc struct

* Extract duplicate code into helper, remove loop labels, use window function

* Make JsValue handling consistent in WasmBezier and add comments for the underlying type

* Add enum for MaximizeArcs Auto/On/Off functionality

* Change Auto to Automatic

* fix errors from resolving merge conflict

* fixed error from resolving merge conflicts

* fixed formatting

* address comments

* Small fix

* Add some missing comments

* address comments

* rename variable

* Use unit to show maximize_arcs values

* Change i32 to usize and other minor adjustments

* Change computation for middle t values

* Remove tsconfig

* Fix more usize number handling

Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Rob Nadal <RobNadal@users.noreply.github.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-08-05 22:34:39 -07:00
luzpaz
5f5c3efdee Fix various typos (#745)
Found via `codespell -q 3 -L complies,crate,doubleclick,ist,ser,vew`
2022-08-05 20:57:52 -07:00
Dennis
83ff548596 Add raster module to graphene_core 2022-08-05 17:43:49 -07:00
Keavon Chambers
c235c7f252 Additional cleanup of prelude imports in editor codebase
Closes #744
2022-08-05 17:12:56 -07:00
Keavon Chambers
ddfd7db0a0 Restructure the entire editor codebase to consistently match the message hierarchy
Closes #744
2022-08-05 17:13:43 -07:00
Dennis
9e1f4eb46d Add license information for node_graph crates 2022-08-04 11:47:38 +02:00
Keavon Chambers
0c7870c5b0 Fix formatting of previous commit 2022-08-04 00:18:42 -07:00
Dennis
5e9545322e Bump dyn-any version + format code 2022-08-04 09:08:48 +02:00
Dennis
30af1ba8db Integrate dyn-any into the main graphite repo 2022-08-04 09:05:19 +02:00
Keavon Chambers
52b3553a75 Add full support for Mac-specific keyboard layouts (#736)
* IPP for Mac, flawed initial experiments

* Cleanup and progress, but not compiling yet

* Fix error and rename nonmac -> standard

* Extentd ipp macros to accomodate mac input

* Add Mac versions of shortcuts; refactor and document the input mapper macros

* Change frontend styling for user input labels in floating menus

* Additional macro documentation

* A little more documentation

* Improve entry macro syntax

* Move input mapper macros to a separate file

* Adapt the keyboard shortcuts to the user's OS

* Display keyboard shortcuts in the menu bar based on OS

* Change Input Mapper macro syntax from {} to ()

* Fix esc key bug in Vue

* Tweaks

* Interim solution for Mac-specific hints

* Feed tooltip input hotkeys from their actions

* Fix hotkeys for tools because of missing actions

* Make Vue respect Ctrl/Cmd differences per platform

* Remove commented lines

* Code review pass by me

* Code review suggestions with TrueDoctor

* Turn FutureKeyMapping struct into ActionKeys enum which is a bit cleaner

* Add serde derive attributes for message discriminants

* Re-add serde deserialize

* Fix not mutating ActionKeys conversion; remove custom serializer

* Add serde to dev dependencies

Co-authored-by: Dennis <dennis@kobert.dev>
2022-08-03 14:13:43 -07:00
Dennis
4fd0042f9b Temporarily remove pretty printing for token streams 2022-08-02 11:53:35 +02:00
Dennis
a348804908 Add dyn-any as a submodule 2022-08-02 11:52:08 +02:00
Dennis
089a3f5684 Compile node graph description to GPU code 2022-08-01 23:44:25 -07:00
Dennis
41a602bba9 Add Unit and Id nodes to node graph 2022-08-01 23:44:24 -07:00
Dennis
09f550bcd4 Don't force nodes to store references to other nodes 2022-08-01 23:44:22 -07:00
Dennis
4b8c0ec4e1 Remove input from the node definition 2022-08-01 23:44:19 -07:00
Dennis
aa5e6f43f6 Add GPU support for node graph 2022-08-01 23:44:18 -07:00
Dennis
bfe21cb179 Implement borrow stack for node graph 2022-08-01 23:44:16 -07:00
Dennis
1ae1fd5704 Make graphene_core no_std 2022-08-01 23:44:14 -07:00
Dennis
119e865007 Restructure node graph proxy architecture 2022-08-01 23:44:13 -07:00
Dennis
6349edfeb3 Replace GAT with lifetime on trait in node graph 2022-08-01 23:44:11 -07:00
Dennis
7384514b87 Try and fail to make nodes object-safe in node graph 2022-08-01 23:44:10 -07:00
Dennis
fef173d3fe Restructure node graph project layout 2022-08-01 23:44:08 -07:00
Dennis
850ca7c73a Add Exec trait to simplify calling nodes without input data 2022-08-01 23:44:07 -07:00
Dennis
a4542b20be Implement ProxyNode for node graph 2022-08-01 23:44:05 -07:00
Dennis
066b57f43e Add Fst- and SndNode to node graph 2022-08-01 23:44:03 -07:00
Dennis
f58f2ee7ed Add FnNode and FnNodeWithState to node graph 2022-08-01 23:44:01 -07:00
Dennis
33244e7122 Finish implementation of compose node 2022-08-01 23:44:00 -07:00
Dennis
49aa948971 Rewrite node graph using generic associated types 2022-08-01 23:43:58 -07:00
Dennis
7a79a892b4 Implement node composition and Cache node 2022-08-01 23:43:56 -07:00
Dennis
4f492b24d2 Transition to a trait-based node graph 2022-08-01 23:43:54 -07:00
TrueDoctor
01bbe5dced Initial implementation of node graph based on structs 2022-08-01 23:43:42 -07:00
Hannah Li
58c1a9db03 Implement self-intersection function for Beziers (#740)
* Initial commit and refactor reduce

* Refactor reduce to get t values

* Implement self intersection

* Return pairs of t values

* Fix results for the case where self is linear and other is not, address other comments

* Update a rustdoc comment

* Address final PR comments
2022-07-31 22:46:33 -04:00
Hannah Li
fd434a11ed Handle intersections between two bezier curves (#735)
* Refactor intersections function

* Implement intersect for quadratic and cubic bezier curves

* Return t value instead of point

* Change project return the t value

* Add error threshold for curve intersection

* Refactor to use if let statements and improve comments

* Refactor intersection helper to return vector, other minor name/text changes

* Rename function

* Minor change

* Minor fixes

* Add missing test tag

* Address comments

* Adjust comment

* Change function call

* Edit comments
2022-07-29 22:37:24 -04:00
Jackie Chen
18871e5bbf Implement curvature function in Bezier math library (#725)
* bezier curvature

* change comment

Co-authored-by: Jackie Chen <jackiechen73>
2022-07-29 21:58:16 -04:00
Hannah Li
b4070f9c90 Implement Bezier scale and offset (#718)
* Implement scale and offset

* Add tests for offset and reduce

* Added scale to documentation page

* address comments

Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Thomas Cheng <Androxium@users.noreply.github.com>
Co-authored-by: Rob Nadal <RobNadal@users.noreply.github.com>
2022-07-28 21:07:24 -04:00
Linda Zheng
06524bac8d Implement function to find inflection points of a Bezier curve (#712)
* Implement inflection function for bezier-rs

* Swapped to explicit inflection formula

Co-authored-by: Linda Zheng <ll2zheng@uwaterloo.ca>

* Address Rob's comments

* Fix axis align

Co-authored-by: Linda Zheng <linda-zheng@users.noreply.github.com>

* Address Keavon's comments

* Fix linting

Co-authored-by: Robert Nadal <Robnadal44@gmail.com>
Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Linda Zheng <linda-zheng@users.noreply.github.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-07-27 22:52:50 -04:00
Linda Zheng
a5bb153dab Implement bounding box function for bezier-rs (#726)
* Implement bounding box function for bezier-rs

* Fix eslint errors

Co-authored-by: Linda Zheng <linda-zheng@users.noreply.github.com>

* Rename bbox to bounding_box

* Address Keavon's comments

* Fix eslint issue

Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Linda Zheng <linda-zheng@users.noreply.github.com>
2022-07-27 22:27:50 -04:00
Rob Nadal
aeb9e85726 Added Subpaths to bezier-rs (#730)
* Added Subpath constructor, iterator and length

* Asserted that subpaths of len < 2 cannot be closed. Added len() and comments

* Added subpath to_svg(), made structs public, made quadratic use either in_handle or out_handle

* add bezier handles

* Added basic interactivity and index traits

* Added SubPath interactivity

* Added svg styling

* Broke subpath impl across multiple files. More sylistic changes per review

* Fixed format error

* Added closed subpath to documentation page

* Modified subpath to_svg to use functional style

* Stylistic changes per review

* Fixed build errors

* More sylistic changes per review

* Moved svg commands to constants

* Moved formatting for svg arguments to ToSVGOptions

* Renamed files in git

* Even more stylistic changes per review
2022-07-27 17:30:08 -04:00
Jackie Chen
8c888e39c7 Implement bezier library's De Casteljau points function (#715)
* pre-rebase

* broken wasm

* hull lines

* update rust lib description

* update comments, handle match statement better, pass Point type to vue

* cleanup

* add linear case

* More idiomatic code

* Further simplifications to the algorithm and removal of more heap allocations

* Rename to de_casteljau_points and use colors for the iterations

* Small comment changes

* Improve colors

Co-authored-by: Jackie Chen <jackiechen73>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Hannah Li <hannahli2010@gmail.com>
2022-07-26 21:35:43 -07:00
Keavon Chambers
cafa2e61dc Update npm dependencies 2022-07-23 15:31:02 -07:00