From b0c5e938b856925a70783dea194ae4a94703a616 Mon Sep 17 00:00:00 2001 From: space-nuko <24979496+space-nuko@users.noreply.github.com> Date: Fri, 7 Apr 2023 05:46:50 -0500 Subject: [PATCH] Better drag and drop --- src/lib/components/ComfyApp.svelte | 15 ++++++++-- src/lib/components/ComfyPane.svelte | 41 ++++++++++++++++++++++----- src/lib/components/ComfyUIPane.svelte | 40 +++++++++++--------------- 3 files changed, 63 insertions(+), 33 deletions(-) diff --git a/src/lib/components/ComfyApp.svelte b/src/lib/components/ComfyApp.svelte index c122f5b..79fd711 100644 --- a/src/lib/components/ComfyApp.svelte +++ b/src/lib/components/ComfyApp.svelte @@ -3,7 +3,6 @@ import { get } from "svelte/store"; import { Pane, Splitpanes } from 'svelte-splitpanes'; import { Button } from "@gradio/button"; - import { Backpack, Gear } from 'radix-icons-svelte'; import ComfyUIPane from "./ComfyUIPane.svelte"; import ComfyApp from "./ComfyApp"; import widgetState from "$lib/stores/widgetState"; @@ -12,6 +11,7 @@ let app: ComfyApp = undefined; let uiPane: ComfyUIPane = undefined; + let containerElem: HTMLDivElement; function refreshView(event) { app.resizeCanvas(); @@ -35,6 +35,12 @@ } } + function testtr() { + console.warn("TESTTR!") + } + + let graphResizeTimer: typeof Timer = -1; + onMount(async () => { app = new ComfyApp(); @@ -47,11 +53,16 @@ refreshView(); (window as any).app = app; + + let graphPaneDiv = containerElem.querySelector("canvas").parentNode as HTMLDivNode; + graphPaneDiv.ontransitionend = () => { + app.resizeCanvas() + } })
-