mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 04:18:12 +08:00
Fix graph scrolling bug from #1021
And replicate those changes to the Svelte version.
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
UpdateNodeGraph,
|
||||
UpdateNodeTypes,
|
||||
UpdateNodeGraphBarLayout,
|
||||
UpdateZoomWithScroll,
|
||||
defaultWidgetLayout,
|
||||
patchWidgetLayout,
|
||||
} from "@/wasm-communication/messages";
|
||||
@@ -20,6 +21,7 @@ export function createNodeGraphState(editor: Editor) {
|
||||
links: [] as FrontendNodeLink[],
|
||||
nodeTypes: [] as FrontendNodeType[],
|
||||
nodeGraphBarLayout: defaultWidgetLayout(),
|
||||
zoomWithScroll: false as boolean,
|
||||
});
|
||||
|
||||
// Set up message subscriptions on creation
|
||||
@@ -42,6 +44,12 @@ export function createNodeGraphState(editor: Editor) {
|
||||
return state;
|
||||
});
|
||||
});
|
||||
editor.subscriptions.subscribeJsMessage(UpdateZoomWithScroll, (updateZoomWithScroll) => {
|
||||
update((state) => {
|
||||
state.zoomWithScroll = updateZoomWithScroll.zoomWithScroll;
|
||||
return state;
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
subscribe,
|
||||
|
||||
Reference in New Issue
Block a user