mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-27 19:38:13 +08:00
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:
committed by
Keavon Chambers
co-authored by
Keavon Chambers
parent
92fe0bea50
commit
d710285029
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user