mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 07:58:11 +08:00
Hook up layer tree structure with frontend (#372)
* Hook up layer tree structure with frontend (decoding and Vue are WIP) * Fix off by one error * Avoid leaking memory * Parse layer structure into list of layers * Fix thumbnail updates * Correctly popagate deletions * Fix selection state in layer tree * Respect expansion during root serialization * Allow expanding of subfolders * Fix arrow direction Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
co-authored by
Dennis Kobert
parent
88bb24a206
commit
f5e03df80b
+23
-13
@@ -4,22 +4,32 @@ import { fullscreenModeChanged } from "@/utilities/fullscreen";
|
||||
import { onKeyUp, onKeyDown, onMouseMove, onMouseDown, onMouseUp, onMouseScroll, onWindowResize } from "@/utilities/input";
|
||||
import "@/utilities/errors";
|
||||
import App from "@/App.vue";
|
||||
import { panicProxy } from "@/utilities/panic-proxy";
|
||||
|
||||
// Bind global browser events
|
||||
window.addEventListener("resize", onWindowResize);
|
||||
window.addEventListener("DOMContentLoaded", onWindowResize);
|
||||
const wasm = import("@/../wasm/pkg").then(panicProxy);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(window as any).wasmMemory = undefined;
|
||||
|
||||
document.addEventListener("contextmenu", (e) => e.preventDefault());
|
||||
document.addEventListener("fullscreenchange", () => fullscreenModeChanged());
|
||||
(async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(window as any).wasmMemory = (await wasm).wasm_memory;
|
||||
|
||||
window.addEventListener("keyup", onKeyUp);
|
||||
window.addEventListener("keydown", onKeyDown);
|
||||
// Initialize the Vue application
|
||||
createApp(App).mount("#app");
|
||||
|
||||
window.addEventListener("mousemove", onMouseMove);
|
||||
window.addEventListener("mousedown", onMouseDown);
|
||||
window.addEventListener("mouseup", onMouseUp);
|
||||
// Bind global browser events
|
||||
window.addEventListener("resize", onWindowResize);
|
||||
onWindowResize();
|
||||
|
||||
window.addEventListener("wheel", onMouseScroll, { passive: false });
|
||||
document.addEventListener("contextmenu", (e) => e.preventDefault());
|
||||
document.addEventListener("fullscreenchange", () => fullscreenModeChanged());
|
||||
|
||||
// Initialize the Vue application
|
||||
createApp(App).mount("#app");
|
||||
window.addEventListener("keyup", onKeyUp);
|
||||
window.addEventListener("keydown", onKeyDown);
|
||||
|
||||
window.addEventListener("mousemove", onMouseMove);
|
||||
window.addEventListener("mousedown", onMouseDown);
|
||||
window.addEventListener("mouseup", onMouseUp);
|
||||
|
||||
window.addEventListener("wheel", onMouseScroll, { passive: false });
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user