Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beginnings of the bezier-rs math library #662

Merged
merged 367 commits into from
Jun 17, 2022
Merged
Changes from 1 commit
Commits
Show all changes
367 commits
Select commit Hold shift + click to select a range
07cc2c2
Improve web infrastructure
Keavon Aug 27, 2021
d6475cf
Minor code readability improvements
Keavon Aug 27, 2021
7513b17
Fix bug where swiching to the Fill Tool would trigger a fill operation
Keavon Aug 27, 2021
8336b3e
Add two-way tool option messaging system between frontend/backend (#361)
henryksloan Aug 29, 2021
913b936
Implement anchor and handle point rendering with the Path Tool (#353)
Keavon Aug 29, 2021
9eb48a0
Add folders to frontend and folder creation to backend (#315)
Keavon Aug 29, 2021
40e91b3
Add space key & drag to pan the canvas (#364)
0HyperCube Aug 30, 2021
a6c57be
(G)rab, (R)otate, and (S)cale layers with hotkeys (#356)
0HyperCube Aug 30, 2021
21c17cc
Dispatcher::handle_message does not need Result anymore (#365)
phimuemue Aug 31, 2021
9af1d9a
Additional WASM translation layer cleanup
Keavon Aug 31, 2021
1999905
Bump tar from 5.0.7 to 5.0.11 in /frontend (#367)
dependabot[bot] Sep 1, 2021
51c2494
Show a crash dialog when the editor panics (#362)
Keavon Sep 1, 2021
636e5d8
Improve and clean up panic dialog code and wasm wrapper (#368)
Keavon Sep 1, 2021
e192b0d
Reorganize and clean up the WASM wrapper
Keavon Sep 1, 2021
0a592b1
Postpone 0.1 launch in readme from Aug to early Sept
Keavon Sep 1, 2021
4f84c70
Upgrade wasm-pack to 0.10.1 (#369)
Keavon Sep 6, 2021
b66607e
Auto-generate third-party license notices (#370)
Keavon Sep 6, 2021
b0cadbc
Additional improvements to license notice formatting
Keavon Sep 7, 2021
1f794d3
Add function to serialize the layer structure to a 1D array (#363)
TrueDoctor Sep 7, 2021
06cf133
Change scrollbar drag color
Keavon Sep 11, 2021
cece89a
Add an intentional panic for debug
Keavon Sep 11, 2021
7822151
Hook up layer tree structure with frontend (#372)
Keavon Sep 12, 2021
f041fb9
Add proper type annotations for panicProxy (#378)
cauthmann Sep 13, 2021
8021899
Do not silently install cargo-about. (#377)
cauthmann Sep 19, 2021
036c504
Fix deployment script (#380)
cauthmann Sep 19, 2021
639862b
id-based-docs (#376)
psuong Sep 20, 2021
a19c4be
Implement interactive scaling/motion of rulers (#306) (#385)
0HyperCube Oct 25, 2021
a6d1a2d
Upgrade Graphite to Rust 2021 edition; upgrade dependencies (#387)
Keavon Nov 1, 2021
c679e8f
Replace vue-svg-loader dependency with simple JS file (fixes a securi…
Keavon Nov 1, 2021
31ca5fd
Update notice for Safari users that BigInt64Array is now supported in…
Keavon Nov 1, 2021
36093f4
Update various node dependencies (#391)
Keavon Nov 1, 2021
7cb8035
Upgrade rustfmt to 2021 edition
Keavon Nov 3, 2021
bf1706b
Layer snapping
0HyperCube Nov 24, 2021
0275248
Switch to Node.js 16 LTS, upgrade TypeScript, ESLint, and other depen…
Keavon Nov 29, 2021
e78b940
Display Asterisk on Unsaved Documents (#392)
mfish33 Nov 30, 2021
8339e31
Confirm when the browser window is closed and there is unsaved work (…
mfish33 Dec 5, 2021
ca4faab
CSS editor layout fixes and scrolling
Keavon Dec 5, 2021
057c180
Change responses to use classes instead of interfaces (#394)
mfish33 Dec 6, 2021
63e9552
Fix ESLint configuration triggering an error in the ESLint VS Code ex…
Keavon Dec 6, 2021
267ad20
Switch CI and CD scripts to use `npm ci` instead of `npm install`
Keavon Dec 6, 2021
ee02b12
Enable vertical scroll wheel on horizontal scrollable containers
Keavon Dec 6, 2021
2255619
Fix bug in last commit that broke when scrolling on SVG elements
Keavon Dec 6, 2021
d376731
Fix blend mode serialization and de-serialization to match (#400)
mfish33 Dec 6, 2021
fbefcb6
Update the project readme
Keavon Dec 7, 2021
50ae24e
Fix floating menus above scrollable content; they now respect content…
Keavon Dec 15, 2021
d07eab0
Clean up JS message dispatcher and fix a bug thrown on empty-data mes…
Keavon Dec 16, 2021
ab049db
Add the Help > About Graphite dialog with build info
Keavon Dec 16, 2021
37be856
Make deployment switch branch from HEAD to master
Keavon Dec 16, 2021
448e72f
Rework wasm initialization and reduce global state (#379)
cauthmann Dec 20, 2021
6b26976
Skip cargo-about in CI to save 5 minutes (#409)
Keavon Dec 20, 2021
cc0a733
Upgrade node packages (#413)
Keavon Dec 20, 2021
96a211f
Fix undefined behavior in the editor wasm bridge (#414)
mfish33 Dec 20, 2021
583e0e8
Set Cargo.toml versions to 0.0.0 to avoid version confusion
Keavon Dec 20, 2021
3b7a554
Change mouse to pointer events (#403)
SonyStone Dec 21, 2021
8f100b4
Skip the web page close confirmation when crashed or in debug mode
Keavon Dec 22, 2021
9020dd7
Make the Pen Tool confirm when leaving the tool
Keavon Dec 22, 2021
15a654b
Move layer selection logic from vue to editor (#410)
otdavies Dec 23, 2021
3a56476
Fix new document position (#421)
0HyperCube Dec 23, 2021
aad4aab
Add a temporary solution to non-Latin keyboards being unusable
Keavon Dec 23, 2021
3155f00
Fix previous commit by mapping codes to keys
Keavon Dec 24, 2021
c0e6756
Implement input hints based on the active tool state (#388)
Keavon Dec 24, 2021
1188e28
Implement outline view mode (#401)
caleb-ad Dec 24, 2021
c55f4f0
Remove all use of document indices (#406)
mfish33 Dec 25, 2021
b1e6deb
Fix bug where duplication with Ctrl+D doesn't properly duplicate (#423)
caleb-ad Dec 26, 2021
7e7c499
Implement IndexedDB document auto-save (#422)
mfish33 Dec 27, 2021
618b7f7
Fix Ctrl+scroll wheel zoom point relative to the mouse position (#429)
0HyperCube Dec 27, 2021
b391b03
Snap while dragging with select tool (#433)
0HyperCube Dec 27, 2021
3aa08ce
Fix console error caused by the Pen Tool (#432)
0HyperCube Dec 28, 2021
0e24c7d
Fix line centering (#431)
0HyperCube Dec 28, 2021
b142423
Implement multiple clipboards (#425)
TrueDoctor Dec 28, 2021
eac9999
Change the select tool to immediately start dragging when clicking a …
TrueDoctor Dec 28, 2021
573468d
Update intoiter syntax (#436)
0HyperCube Dec 28, 2021
9ee95d4
Remove snap rotate from layerdata (#435)
0HyperCube Dec 28, 2021
612732f
Fix the File > Close All crash (#438)
otdavies Dec 29, 2021
82e63ea
Populate layer entry cache (#437)
0HyperCube Dec 29, 2021
62fc882
Add cut, copy, and paste to the Edit menu (#440)
0HyperCube Dec 30, 2021
cc560cb
Drag to rearrange layers in the layer panel (#434)
0HyperCube Dec 30, 2021
dfa303a
New overlay system that reimplements how overlays are drawn (#418)
Keavon Dec 30, 2021
4689e47
Fix one item folders (#442)
0HyperCube Dec 31, 2021
1c834ba
Remove transformations from LayerData (#439)
0HyperCube Dec 31, 2021
401bba8
Add navigate tool (#441)
0HyperCube Dec 31, 2021
5a184a1
Fix all clippy lint errors
Keavon Dec 31, 2021
90d725f
Rename Editor's LayerData to LayerMetadata
Keavon Dec 31, 2021
c64f858
Major frontend code cleanup (#452)
Keavon Jan 2, 2022
463ff1a
Vue/TS bug and bad typing fixes
Keavon Jan 3, 2022
7da03d7
Fix to send panic message to all editor instances immediately upon cr…
mfish33 Jan 3, 2022
6a2ae55
Fix group creation parenting (#455)
otdavies Jan 5, 2022
0219f06
Fix build script to use correct branch name
Keavon Jan 5, 2022
f4707f9
Better decimal rounding in the NumberInput widget (#457)
mfish33 Jan 7, 2022
c1c7192
Tidy up path handling in document_file (#464)
TrueDoctor Jan 7, 2022
8e3d237
Ungroup layers (#465)
otdavies Jan 7, 2022
05e8a98
Redesign the Layer Tree UI (#468)
Keavon Jan 8, 2022
11f15bd
Path Tool: Implement anchor point dragging (#451)
leonardpauli Jan 8, 2022
54e9121
Implement artboards and document version enforcement (#466)
mfish33 Jan 8, 2022
a2c2f7f
Add support for resizing workspace panels (#443)
0HyperCube Jan 8, 2022
3eeac79
Enhance the Navigate Tool zoom behavior (#461)
0HyperCube Jan 8, 2022
61432de
Fix rotation input (#472)
0HyperCube Jan 8, 2022
9f54a37
Fix bounds with artboards for zoom-to-fit and scrollbar scaling (#473)
mfish33 Jan 9, 2022
095d577
Fix NumberInput clamping regression with undefined bounds
Keavon Jan 11, 2022
389b445
Remove Charcoal references from the code for now
Keavon Jan 12, 2022
75e8fc6
Switch VS Code's Vue extension from Vetur to Volar
Keavon Jan 12, 2022
5740283
Add `npm start` script alias for `npm run serve`
Keavon Jan 12, 2022
c76c92e
Migrate to using MoveSelectedLayersTo (#469)
0HyperCube Jan 12, 2022
0991312
Rename document_message_handler.rs to portfolio_message_handler.rs
Keavon Jan 12, 2022
ec7bf4a
Rename DocumentsMessage to PortfolioMessage
Keavon Jan 12, 2022
0b4934b
Rename document_file.rs to document_message_handler.rs
Keavon Jan 12, 2022
e708588
Standardize FrontendMessage message names
Keavon Jan 12, 2022
a535f5c
Sort messages and message handlers
Keavon Jan 13, 2022
9b6cbb5
Massively reorganize and clean up the whole Rust codebase (#478)
Keavon Jan 14, 2022
ea2d003
Modify all message enum data to use named struct values, not tuples (…
Keavon Jan 15, 2022
fa390c3
Change canvas artboard background color to be 1 shade lighter
Keavon Jan 15, 2022
2cc39cd
Tweak whitespace around `use` statements and other lint fixes
Keavon Jan 15, 2022
9b36e6a
Fix all remaining Vue/TS errors flagged in Volar
Keavon Jan 16, 2022
dbc1991
Set the mouse cursor in the canvas based on the current tool and its …
asyncth Jan 16, 2022
d1bf2e0
Do not transform layers when transforming a parent folder (#481)
0HyperCube Jan 16, 2022
122ff94
Make the toggle overlays button functional (#484)
Keavon Jan 16, 2022
e3f47e1
Add cursors and hints to global viewport navigation (#487)
0HyperCube Jan 16, 2022
66fac95
Fix sorting of message enum variants
Keavon Jan 16, 2022
ab0096c
Reverse layer panel entries (#489)
0HyperCube Jan 16, 2022
e3a2752
Generify functions in document.rs (#488)
TrueDoctor Jan 18, 2022
0a2890c
Add alignment overlays (#462)
0HyperCube Jan 20, 2022
0dbcd3e
Move scrollable behavior into LayoutRow/LayoutCol
Keavon Jan 23, 2022
7eb5d75
Clean up web code's use of display CSS properties, using <LayoutRow>/…
Keavon Jan 24, 2022
607fea0
Simplify point storage for pen tool (#500)
TrueDoctor Jan 27, 2022
46cf9b5
Add folder outline insert marker and clean up layer insertion Vue cod…
0HyperCube Jan 29, 2022
e5e3e14
Add folder outline insert marker and clean up layer insertion Vue cod…
0HyperCube Jan 29, 2022
6e47980
Add folder outline insert marker and clean up layer insertion Vue cod…
0HyperCube Jan 29, 2022
498e79b
Implement layer renaming (#501)
Keavon Jan 29, 2022
e0d4eb3
Implement Freehand Tool (#503)
pkupper Jan 30, 2022
a6f3e79
Implement the Text Tool and text layer MVP (#492)
0HyperCube Jan 30, 2022
2454fa6
Layout system implementation and applied to tool options bar (#499)
mfish33 Jan 31, 2022
10f57c6
Fix overlays on document switching (#505)
0HyperCube Feb 3, 2022
ce34919
Rename deployment script
Keavon Feb 4, 2022
3dfeb48
Clean up text input (#506)
0HyperCube Feb 4, 2022
3a26270
Transformation cage (#502)
0HyperCube Feb 4, 2022
cee7486
Double click on a SimpleShape to path edit (#507)
0HyperCube Feb 5, 2022
b537122
Add log level selection to help menu (#511)
pkupper Feb 5, 2022
def2ac7
Bump follow-redirects from 1.14.5 to 1.14.7 in /frontend (#515)
dependabot[bot] Feb 5, 2022
53d9935
Bump nanoid from 3.1.30 to 3.2.0 in /frontend (#514)
dependabot[bot] Feb 5, 2022
7a68ad4
Solve "Coming Soon" dialog from bubbled click event on sub-menu entri…
Keavon Feb 5, 2022
6f50063
Fix shape not closed after using Fill Tool (#510)
pkupper Feb 6, 2022
0f4158a
De duplicate Overlay render messages (#520)
TrueDoctor Feb 7, 2022
21e3b5e
Set text fill color to the primary color (#521)
pkupper Feb 7, 2022
ee55fab
Place new layers in tree based on layer selection (#526)
simonwuelker Feb 9, 2022
5ca88e6
Add the TextInput widget (#518)
Keavon Feb 9, 2022
448fee3
Overhaul Path Tool (#498)
otdavies Feb 9, 2022
d7c4159
Fix TextInput widget casting from string to number by mistake (#528)
0HyperCube Feb 9, 2022
67ed863
Implement the Crop Tool for artboard resizing (#519)
0HyperCube Feb 9, 2022
6f4f193
Implement the Spline Tool (#512)
pkupper Feb 10, 2022
0349f6e
Improve Path Tool hint text
Keavon Feb 10, 2022
7944137
Polishing: standardize binding JS resize event (fixes non-integer AA …
Keavon Feb 10, 2022
2ed52bf
Allow deleting artboards (#533)
0HyperCube Feb 10, 2022
85d3249
Properly show document bar on initialization (#535)
mfish33 Feb 11, 2022
e974843
Add Pen Tool (#536)
otdavies Feb 12, 2022
216e051
Implement the Properties panel with a transform section for layers (#…
mfish33 Feb 12, 2022
2de5e8f
Boolean shape operations (#470)
caleb-ad Feb 12, 2022
3c52bc7
Release Alpha Milestone 1!
Keavon Feb 12, 2022
615b14a
Rename tools (#537)
0HyperCube Feb 12, 2022
dbe2143
Reduce transformation cage rotate tolerance (#548)
0HyperCube Feb 13, 2022
8d1f229
Gradient Tool (#546)
0HyperCube Feb 14, 2022
d096e3d
Can set stroke and fill on text and shapes (#551)
mfish33 Feb 15, 2022
0f2a97b
fix crash when shape does not have fill (#557)
mfish33 Feb 16, 2022
ff5dff9
Fix panic on non existing document layer
TrueDoctor Feb 16, 2022
8c58b28
Create project website with near-complete home page
Keavon Feb 17, 2022
7132da3
Website responsive resizing improvements
Keavon Feb 19, 2022
c02fb13
Add newsletter signup to website
Keavon Feb 19, 2022
6cb1220
Pen tool fixes (#563)
otdavies Feb 21, 2022
c1137ee
Color Input (#565)
mfish33 Feb 22, 2022
7faf6e6
Add "New Folder"/"Delete Selected" buttons to layer panel
Keavon Mar 3, 2022
dce6c88
Update npm dependencies
Keavon Mar 3, 2022
63aeea9
Set text color based on its fill when it's being edited
Keavon Mar 4, 2022
97962d2
Reorder tool icons, update favicon and logo, and other icon cleanup
Keavon Mar 4, 2022
c10b719
Remake node type icons (closes #483); color picker cleanup
Keavon Mar 5, 2022
4629c20
Change tool shelf icon colors to use classes not style
Keavon Mar 6, 2022
03fea5e
Add Image node icon and rename node from Path to Shape
Keavon Mar 6, 2022
f0c8644
Add website revisions and many new pages
Keavon Mar 12, 2022
ef67351
Add features page and fixes to website
Keavon Mar 13, 2022
0646677
Fix clippy lints and update packages (#568)
0HyperCube Mar 14, 2022
4f3c99b
Fix type error in Brave browser (#569)
TrueDoctor Mar 15, 2022
5975890
Small website text improvements
Keavon Mar 15, 2022
4637f09
Various website fixes
Keavon Mar 17, 2022
aec23d1
Add node graph mockup to website
Keavon Mar 25, 2022
51ba5f1
Differentiate between scale and dimensions (#570)
TrueDoctor Mar 27, 2022
965f393
Add embedable images (#564)
0HyperCube Mar 27, 2022
2efc376
Bump minimist from 1.2.5 to 1.2.6 in /frontend (#571)
dependabot[bot] Mar 31, 2022
3e37940
Fix panic dialogue when handling a message (#573)
0HyperCube Apr 2, 2022
00fa3c6
Add documentation to many parts of the Rust codebase (#552)
simonwuelker Apr 9, 2022
31b5f79
Add additional stroke properties (#582)
0HyperCube Apr 9, 2022
061a834
Expand upon the "Announcing Graphite alpha" blog post
Keavon Apr 14, 2022
323f681
All shapes now have a Fill in the properties panel; color inputs are …
0HyperCube Apr 18, 2022
df5b3d3
New blog post: "Distributed computing with the Graphene runtime"
Keavon Apr 16, 2022
cef411a
Fix gradient transformation (#588)
0HyperCube Apr 20, 2022
1181feb
Add properties panel entries for artboards (#572)
mfish33 Apr 21, 2022
b9bbdbb
Font selection for text layers (#585)
0HyperCube Apr 21, 2022
c75ed17
Improvements to the layer transform cage UX (#589)
0HyperCube Apr 21, 2022
b0bca00
Rename Crop tool to Artboard tool
Keavon Apr 21, 2022
afa1d72
Stop pointerdown event from properties panel (#600)
0HyperCube Apr 21, 2022
e0d9d46
Change stroke weight from ints to floats (#601)
Keavon Apr 21, 2022
320653b
Fix properties deselect (#606)
0HyperCube Apr 22, 2022
c947d1b
Draw the outlines of shapes on hover and selection (#609)
0HyperCube Apr 24, 2022
f465793
Upgrade vue-cli to version 5 (#594)
Keavon Apr 26, 2022
7c71865
Tidy up the full frontend codebase and use optional chaining where po…
Keavon Apr 30, 2022
5784ca0
Add a hotkey to select a random primary color (#622)
FlorentCollin May 6, 2022
fcb8b99
Move the Layer Tree panel's New Folder and Delete icons into the opti…
Keavon May 6, 2022
3ba07ee
Migrate dialogs to Rust and add a New File dialog (#623)
0HyperCube May 7, 2022
890e69a
Snapping system improvements and refactor (#621)
0HyperCube May 9, 2022
ae43ae8
Add the File > Export dialog and PNG/JPG downloading (#629)
0HyperCube May 9, 2022
9e5a5a3
Clean up website file structure
Keavon May 10, 2022
c6d767e
Shape boolean operation improvements (#547)
caleb-ad May 11, 2022
2cab9e1
Update list of recommended VS Code extensions
Keavon May 11, 2022
602d5a0
Build the node graph frontend with placeholder graph info (#581)
Keavon May 11, 2022
a34db9f
Blog post updates
Keavon May 12, 2022
f397f1c
Fix website URL encoding in certain links
Keavon May 12, 2022
3bd3f49
Add Reddit and Twitter links to blog posts
Keavon May 12, 2022
bfc0579
Restore the zoom to fit behaviour in new bounded documents (#641)
0HyperCube May 12, 2022
9c299fb
Fix website responsive layouts
Keavon May 12, 2022
5a3db9b
Fix website rendering issues on Firefox with -webkit-line-clamp
Keavon May 12, 2022
e2b61e7
Update the VS Code rust-analyzer extension to its new official owner
Keavon May 13, 2022
a5ae57e
Move layouts definitions to backend and fix Firefox overlay scrollbar…
Keavon May 17, 2022
df675a7
Fix polygon overflow (#644)
Androxium May 20, 2022
a32f41f
Vue initialization and FloatingMenu codebase refactoring and cleanup …
Keavon May 22, 2022
f94e26b
Add basic support for radial gradients (#639)
hannahli2010 May 24, 2022
88f0b3c
Update the assets directory to prefix icon folders with "icon-"
Keavon May 22, 2022
cf52d7c
Reorganize Vue components and add documentation explaining each folder
Keavon May 24, 2022
be66f28
Add frontend file structure docs and some related cleanup
Keavon May 24, 2022
5d11f6f
Fix paste into UI (#654)
0HyperCube May 24, 2022
2fc4977
Refactor source of Git commit build info (closes #661)
Keavon May 24, 2022
c8e1c0c
Initial commit for the bezier math library
hannahli2010 May 23, 2022
5f13b14
Add Cargo.toml for bezier-rs/lib and test function
hannahli2010 May 25, 2022
5581044
Fix lint error
hannahli2010 May 25, 2022
2e5ccfe
Keyboard menu/widget navigation (#628)
0HyperCube May 25, 2022
fd95326
Update readme
Keavon May 25, 2022
d4d1483
Fix viewport tilt/zoom while snapping to show snapped values (#663)
RahulHi May 26, 2022
4411599
Refactor font loading from per-document to the portfolio (#659)
0HyperCube May 26, 2022
7b5ab3c
Update banner for the lastest blog post
Keavon Jun 6, 2022
216af65
Fix crash when deselecting layer while editing properties (#665)
mfish33 Jun 7, 2022
59578c8
Fix crash on closing all documents (#666)
mfish33 Jun 7, 2022
5a9518f
Preserve layer stacking order on copy and paste (#668)
nupsi Jun 8, 2022
9a0afa3
Fix nudge and textbox creation (#672)
0HyperCube Jun 10, 2022
e039b46
Fix hover outline when panning (#673)
0HyperCube Jun 10, 2022
f30b04b
Implement viewport culling (#667)
mfish33 Jun 10, 2022
c0bac28
Add font menu previews and virtual scrolling (#650)
0HyperCube Jun 10, 2022
b31d522
Fix Ctrl+Enter to commit text (#675)
0HyperCube Jun 11, 2022
7265ee9
Starter implementation of Bezier library and UI documentation (#664)
hannahli2010 Jun 11, 2022
94544ba
Bezier length implementation (#676)
hannahli2010 Jun 13, 2022
0eed5dc
Update npm dependencies (#678)
Keavon Jun 13, 2022
f00be1b
Add get and getLUT functions (#677)
hannahli2010 Jun 14, 2022
b625a8f
Remove prettier settings in .vscode
linda-zheng Jun 16, 2022
60737fe
Merge branch 'old-master' into bezier-math-lib
Keavon Jun 17, 2022
65140a2
Merge branch 'master' into bezier-math-lib
Keavon Jun 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
(G)rab, (R)otate, and (S)cale layers with hotkeys (#356)
* Add handler and input mapping.

* Selecting transform type

* Add translation and axis constraints

* Remove unnecessary Key::

* Add rotation

* Centre pivot point for rotation

* Add scaling

* Select Tool bounding box now updates when transforming

* Add typing

* Shift to slow mouse movements

* Add snapping

* Refactor modifier keys

* Refactor to apply only 1 operation per frame

* Refactor to fix scale 0 issue

* Remove logging

* Avoid multiple decimol points in queue

* Add typing negative

* Add typing negative values

* Fix bounding box on apply/abort; fix some variable names

* Allow transform to daffine2 identity

* Revert previous operation when changing operation

* Remove repopulate transforms method

* Code readability tweaks

Co-authored-by: Keavon Chambers <[email protected]>
0HyperCube and Keavon authored Aug 30, 2021

Unverified

No user is associated with the committer email.
commit a6c57be47675ed39a79f16692d6f59365ceae598
5 changes: 5 additions & 0 deletions editor/src/consts.rs
Original file line number Diff line number Diff line change
@@ -15,6 +15,11 @@ pub const VIEWPORT_SCROLL_RATE: f64 = 0.6;

pub const VIEWPORT_ROTATE_SNAP_INTERVAL: f64 = 15.;

// TRANSFORMING LAYER
pub const ROTATE_SNAP_ANGLE: f64 = 15.;
pub const SCALE_SNAP_INTERVAL: f64 = 0.1;
pub const SLOWING_DIVISOR: f64 = 10.;

// SELECT TOOL
pub const SELECTION_TOLERANCE: f64 = 1.;

8 changes: 8 additions & 0 deletions editor/src/document/document_file.rs
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ use log::warn;
use std::collections::VecDeque;

use super::movement_handler::{MovementMessage, MovementMessageHandler};
use super::transform_layer_handler::{TransformLayerMessage, TransformLayerMessageHandler};

type DocumentSave = (InternalDocument, HashMap<Vec<LayerId>, LayerData>);

@@ -63,6 +64,7 @@ pub struct DocumentMessageHandler {
pub name: String,
pub layer_data: HashMap<Vec<LayerId>, LayerData>,
movement_handler: MovementMessageHandler,
transform_layer_handler: TransformLayerMessageHandler,
}

impl Default for DocumentMessageHandler {
@@ -74,6 +76,7 @@ impl Default for DocumentMessageHandler {
name: String::from("Untitled Document"),
layer_data: vec![(vec![], LayerData::new(true))].into_iter().collect(),
movement_handler: MovementMessageHandler::default(),
transform_layer_handler: TransformLayerMessageHandler::default(),
}
}
}
@@ -83,6 +86,8 @@ impl Default for DocumentMessageHandler {
pub enum DocumentMessage {
#[child]
Movement(MovementMessage),
#[child]
TransformLayers(TransformLayerMessage),
DispatchOperation(Box<DocumentOperation>),
SetSelectedLayers(Vec<Vec<LayerId>>),
AddSelectedLayers(Vec<Vec<LayerId>>),
@@ -260,6 +265,7 @@ impl DocumentMessageHandler {
name,
layer_data: vec![(vec![], LayerData::new(true))].into_iter().collect(),
movement_handler: MovementMessageHandler::default(),
transform_layer_handler: TransformLayerMessageHandler::default(),
}
}

@@ -361,6 +367,7 @@ impl MessageHandler<DocumentMessage, &InputPreprocessor> for DocumentMessageHand
use DocumentMessage::*;
match message {
Movement(message) => self.movement_handler.process_action(message, (layer_data(&mut self.layer_data, &[]), &self.document, ipp), responses),
TransformLayers(message) => self.transform_layer_handler.process_action(message, (&mut self.layer_data, &mut self.document, ipp), responses),
DeleteLayer(path) => responses.push_back(DocumentOperation::DeleteLayer { path }.into()),
StartTransaction => self.backup(),
RollbackTransaction => {
@@ -710,6 +717,7 @@ impl MessageHandler<DocumentMessage, &InputPreprocessor> for DocumentMessageHand
common.extend(select);
}
common.extend(self.movement_handler.actions());
common.extend(self.transform_layer_handler.actions());
common
}
}
2 changes: 1 addition & 1 deletion editor/src/document/document_message_handler.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::input::InputPreprocessor;
use crate::message_prelude::*;
use graphene::layers::{Layer, LayerDataType};
use graphene::layers::Layer;
use graphene::{LayerId, Operation as DocumentOperation};
use log::warn;

3 changes: 3 additions & 0 deletions editor/src/document/mod.rs
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ mod document_file;
mod document_message_handler;
pub mod layer_panel;
mod movement_handler;
mod transform_layer_handler;

#[doc(inline)]
pub use document_file::LayerData;
@@ -12,3 +13,5 @@ pub use document_file::{AlignAggregate, AlignAxis, DocumentMessage, DocumentMess
pub use document_message_handler::{DocumentsMessage, DocumentsMessageDiscriminant, DocumentsMessageHandler};
#[doc(inline)]
pub use movement_handler::{MovementMessage, MovementMessageDiscriminant};
#[doc(inline)]
pub use transform_layer_handler::{TransformLayerMessage, TransformLayerMessageDiscriminant};
551 changes: 551 additions & 0 deletions editor/src/document/transform_layer_handler.rs

Large diffs are not rendered by default.

33 changes: 32 additions & 1 deletion editor/src/input/input_mapper.rs
Original file line number Diff line number Diff line change
@@ -131,6 +131,21 @@ impl Default for Mapping {
// it as an available action in the respective message handler file (such as the bottom of `document_message_handler.rs`)
let mappings = mapping![
// Higher priority than entries in sections below
entry! {action=DocumentsMessage::Paste, key_down=KeyV, modifiers=[KeyControl]},
entry! {action=MovementMessage::EnableSnapping, key_down=KeyShift},
entry! {action=MovementMessage::DisableSnapping, key_up=KeyShift},
// Transform layers
entry! {action=TransformLayerMessage::ApplyOperation, key_down=KeyEnter},
entry! {action=TransformLayerMessage::ApplyOperation, key_down=Lmb},
entry! {action=TransformLayerMessage::CancelOperation, key_down=KeyEscape},
entry! {action=TransformLayerMessage::CancelOperation, key_down=Rmb},
entry! {action=TransformLayerMessage::ConstrainX, key_down=KeyX},
entry! {action=TransformLayerMessage::ConstrainY, key_down=KeyY},
entry! {action=TransformLayerMessage::TypeBackspace, key_down=KeyBackspace},
entry! {action=TransformLayerMessage::TypeNegate, key_down=KeyMinus},
entry! {action=TransformLayerMessage::TypeDecimalPoint, key_down=KeyComma},
entry! {action=TransformLayerMessage::TypeDecimalPoint, key_down=KeyPeriod},
entry! {action=TransformLayerMessage::MouseMove{slow_key: KeyShift, snap_key: KeyControl}, triggers=[KeyShift, KeyControl]},
// Select
entry! {action=SelectMessage::MouseMove, message=InputMapperMessage::PointerMove},
entry! {action=SelectMessage::DragStart{add_to_selection: KeyShift}, key_down=Lmb},
@@ -201,6 +216,10 @@ impl Default for Mapping {
entry! {action=DocumentMessage::ExportDocument, key_down=KeyE, modifiers=[KeyControl]},
entry! {action=DocumentMessage::SaveDocument, key_down=KeyS, modifiers=[KeyControl]},
entry! {action=DocumentMessage::SaveDocument, key_down=KeyS, modifiers=[KeyControl, KeyShift]},
// Initiate Transform Layers
entry! {action=TransformLayerMessage::BeginGrab, key_down=KeyG},
entry! {action=TransformLayerMessage::BeginRotate, key_down=KeyR},
entry! {action=TransformLayerMessage::BeginScale, key_down=KeyS},
// Document movement
entry! {action=MovementMessage::MouseMove, message=InputMapperMessage::PointerMove},
entry! {action=MovementMessage::RotateCanvasBegin{snap:false}, key_down=Mmb, modifiers=[KeyControl]},
@@ -231,7 +250,7 @@ impl Default for Mapping {
entry! {action=DocumentsMessage::CloseActiveDocumentWithConfirmation, key_down=KeyW, modifiers=[KeyControl]},
entry! {action=DocumentMessage::DuplicateSelectedLayers, key_down=KeyD, modifiers=[KeyControl]},
entry! {action=DocumentsMessage::Copy, key_down=KeyC, modifiers=[KeyControl]},
entry! {action=DocumentMessage::GroupSelectedLayers, key_down=KeyG},
entry! {action=DocumentMessage::GroupSelectedLayers, key_down=KeyG, modifiers=[KeyControl]},
// Nudging
entry! {action=DocumentMessage::NudgeSelectedLayers(-SHIFT_NUDGE_AMOUNT, -SHIFT_NUDGE_AMOUNT), key_down=KeyArrowUp, modifiers=[KeyShift, KeyArrowLeft]},
entry! {action=DocumentMessage::NudgeSelectedLayers(SHIFT_NUDGE_AMOUNT, -SHIFT_NUDGE_AMOUNT), key_down=KeyArrowUp, modifiers=[KeyShift, KeyArrowRight]},
@@ -257,6 +276,7 @@ impl Default for Mapping {
entry! {action=DocumentMessage::NudgeSelectedLayers(NUDGE_AMOUNT, -NUDGE_AMOUNT), key_down=KeyArrowRight, modifiers=[KeyArrowUp]},
entry! {action=DocumentMessage::NudgeSelectedLayers(NUDGE_AMOUNT, NUDGE_AMOUNT), key_down=KeyArrowRight, modifiers=[KeyArrowDown]},
entry! {action=DocumentMessage::NudgeSelectedLayers(NUDGE_AMOUNT, 0.), key_down=KeyArrowRight},
// Reorder Layers
entry! {action=DocumentMessage::ReorderSelectedLayers(i32::MAX), key_down=KeyRightCurlyBracket, modifiers=[KeyControl]}, // TODO: Use KeyRightBracket with ctrl+shift modifiers once input system is fixed
entry! {action=DocumentMessage::ReorderSelectedLayers(1), key_down=KeyRightBracket, modifiers=[KeyControl]},
entry! {action=DocumentMessage::ReorderSelectedLayers(-1), key_down=KeyLeftBracket, modifiers=[KeyControl]},
@@ -268,6 +288,17 @@ impl Default for Mapping {
];

let (mut key_up, mut key_down, mut pointer_move, mut mouse_scroll) = mappings;
const NUMBER_KEYS: [Key; 10] = [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8, Key9];
for (i, key) in NUMBER_KEYS.iter().enumerate() {
key_down[*key as usize].0.insert(
0,
MappingEntry {
trigger: InputMapperMessage::KeyDown(*key),
modifiers: modifiers! {},
action: TransformLayerMessage::TypeNumber(i as u8).into(),
},
);
}
let sort = |list: &mut KeyMappingEntries| list.0.sort_by(|u, v| v.modifiers.ones().cmp(&u.modifiers.ones()));
for list in [&mut key_up, &mut key_down] {
for sublist in list {
2 changes: 2 additions & 0 deletions editor/src/input/keyboard.rs
Original file line number Diff line number Diff line change
@@ -80,6 +80,8 @@ pub enum Key {
KeyRightCurlyBracket,
KeyPageUp,
KeyPageDown,
KeyComma,
KeyPeriod,

// This has to be the last element in the enum.
NumKeys,
1 change: 1 addition & 0 deletions editor/src/lib.rs
Original file line number Diff line number Diff line change
@@ -55,6 +55,7 @@ pub mod message_prelude {
pub use crate::document::{DocumentMessage, DocumentMessageDiscriminant};
pub use crate::document::{DocumentsMessage, DocumentsMessageDiscriminant};
pub use crate::document::{MovementMessage, MovementMessageDiscriminant};
pub use crate::document::{TransformLayerMessage, TransformLayerMessageDiscriminant};
pub use crate::frontend::{FrontendMessage, FrontendMessageDiscriminant};
pub use crate::global::{GlobalMessage, GlobalMessageDiscriminant};
pub use crate::input::{InputMapperMessage, InputMapperMessageDiscriminant, InputPreprocessorMessage, InputPreprocessorMessageDiscriminant};
2 changes: 2 additions & 0 deletions frontend/wasm/src/wrappers.rs
Original file line number Diff line number Diff line change
@@ -154,6 +154,8 @@ pub fn translate_key(name: &str) -> Key {
"}" => KeyRightCurlyBracket,
"pageup" => KeyPageUp,
"pagedown" => KeyPageDown,
"," => KeyComma,
"." => KeyPeriod,
_ => UnknownKey,
}
}
6 changes: 5 additions & 1 deletion graphene/src/layers/mod.rs
Original file line number Diff line number Diff line change
@@ -137,8 +137,12 @@ impl Layer {
self.data.intersects_quad(transformed_quad, path, intersections)
}

pub fn current_bounding_box_with_transform(&self, transform: DAffine2) -> Option<[DVec2; 2]> {
self.data.bounding_box(transform)
}

pub fn current_bounding_box(&self) -> Option<[DVec2; 2]> {
self.data.bounding_box(self.transform)
self.current_bounding_box_with_transform(self.transform)
}

pub fn as_folder_mut(&mut self) -> Result<&mut Folder, DocumentError> {