From a2c2f7fc9da5beb73f677e95d5b4095cd8851318 Mon Sep 17 00:00:00 2001 From: 0HyperCube <78500760+0HyperCube@users.noreply.github.com> Date: Sat, 8 Jan 2022 16:02:02 +0000 Subject: [PATCH] Add support for resizing workspace panels (#443) * Resize panels * Removing move_selection test pending #444 resolved * Bind event listners and cursor to the document * Fix flex grow on document being reset when drawing * Call onresize when the boundry is dragged * Add min panel size * Add explicit function return types * Dispatch resize event * Lock pointer instead of setting cursor on document Co-authored-by: otdavies Co-authored-by: Keavon Chambers --- editor/src/communication/dispatcher.rs | 1 + frontend/src/App.vue | 2 +- .../src/components/workspace/Workspace.vue | 58 +++++++++++++++++-- 3 files changed, 56 insertions(+), 5 deletions(-) diff --git a/editor/src/communication/dispatcher.rs b/editor/src/communication/dispatcher.rs index f6d856055..c41deb314 100644 --- a/editor/src/communication/dispatcher.rs +++ b/editor/src/communication/dispatcher.rs @@ -330,6 +330,7 @@ mod test { assert_eq!(&layers_after_copy[4], rect_before_copy); assert_eq!(&layers_after_copy[5], ellipse_before_copy); } + #[test] #[ignore] // TODO: Re-enable test, see issue #444 (https://github.com/GraphiteEditor/Graphite/pull/444) /// - create rect, shape and ellipse diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 77d472ad9..2ef8c078d 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -241,7 +241,7 @@ declare module "@vue/runtime-core" { editor: EditorState; // This must be set to optional because there is a time in the lifecycle of the component where inputManager is undefined. // That's because we initialize inputManager in `mounted()` rather than `data()` since the div hasn't been created yet. - inputManger?: InputManager; + inputManager?: InputManager; } } diff --git a/frontend/src/components/workspace/Workspace.vue b/frontend/src/components/workspace/Workspace.vue index eec1eed2d..4c709655c 100644 --- a/frontend/src/components/workspace/Workspace.vue +++ b/frontend/src/components/workspace/Workspace.vue @@ -1,6 +1,6 @@