refactor: how the keymap gets to the viewer

This commit is contained in:
2024-04-19 22:00:43 +02:00
parent e575974872
commit 1d203c687c
6 changed files with 26 additions and 15 deletions

View File

@ -79,7 +79,6 @@
$: if ($colors.outline) {
lineColor.copyLinearToSRGB($colors.outline);
console.log("lineColor", lineColor);
}
</script>

View File

@ -2,9 +2,10 @@
import type { Graph, NodeRegistry } from "@nodes/types";
import GraphEl from "./Graph.svelte";
import { GraphManager } from "../graph-manager.js";
import { createEventDispatcher } from "svelte";
import { createEventDispatcher, setContext } from "svelte";
import type { Writable } from "svelte/store";
import { debounce } from "$lib/helpers";
import { createKeyMap } from "$lib/helpers/createKeyMap";
export let registry: NodeRegistry;
export let graph: Graph;
@ -14,6 +15,9 @@
export const status = manager.status;
export const keymap = createKeyMap([]);
setContext("keymap", keymap);
const updateSettings = debounce((s) => {
manager.setSettings(s);
}, 200);