Fix regressions introduced in the vector nodes migration (#1100)

* Fix double click to enter path tool

* Fix error

* Fix transform bug

* Fix squaring scale on images

* Shift node position and refresh graph

* Downscale node seperate

* Fix mirror

* Remove duplicate transform

* Always show node graph

* Correctly set freehand and spline tool positions

* Run cargo format

* Maybe fix the scale

* Downscaled image is always smaller than origional

* Fix one crash

* Don't show node graph on welcome screen

* Reduce default graph panel height

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2023-03-31 21:15:49 +01:00
committed by Keavon Chambers
co-authored by Keavon Chambers
parent 92fe0bea50
commit d710285029
23 changed files with 105 additions and 118 deletions
+2 -15
View File
@@ -1,28 +1,15 @@
/* eslint-disable max-classes-per-file */
import {tick} from "svelte";
import {writable} from "svelte/store";
import { type Editor } from "@graphite/wasm-communication/editor";
import { UpdateNodeGraphVisibility } from "@graphite/wasm-communication/messages";
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export function createWorkspaceState(editor: Editor) {
const { subscribe, update } = writable({
nodeGraphVisible: false,
});
const { subscribe, update } = writable({});
// Set up message subscriptions on creation
editor.subscriptions.subscribeJsMessage(UpdateNodeGraphVisibility, async (updateNodeGraphVisibility) => {
update((state) => {
state.nodeGraphVisible = updateNodeGraphVisibility.visible;
return state;
});
// Update the viewport bounds
await tick();
window.dispatchEvent(new Event("resize"));
});
return {
subscribe,