Improve mobile app initialization and range widget corner indicator

This commit is contained in:
space-nuko
2023-05-07 16:10:44 -05:00
parent efb0010a0e
commit 6dd2627f2c
16 changed files with 230 additions and 70 deletions

View File

@@ -6,13 +6,10 @@
import { onMount } from 'svelte';
import uiState from "$lib/stores/uiState"
let app: ComfyApp | null = null;
export let app: ComfyApp | null = null;
let lCanvas: ComfyGraphCanvas | null = null;
let canvasEl: HTMLCanvasElement | null = null;
$: if (!app)
app = $uiState.app
function resizeCanvas() {
canvasEl.width = canvasEl.parentElement.offsetWidth;
canvasEl.height = canvasEl.parentElement.offsetHeight;
@@ -21,13 +18,10 @@
lCanvas.draw(true, true);
}
$: if (app != null && canvasEl != null) {
$: if (app != null && app.lGraph && canvasEl != null) {
if (!lCanvas) {
lCanvas = new ComfyGraphCanvas(app, canvasEl);
lCanvas.allow_interaction = false;
LiteGraph.dialog_close_on_mouse_leave = false;
LiteGraph.search_hide_on_mouse_leave = false;
LiteGraph.pointerevents_method = "pointer";
app.lGraph.eventBus.on("afterExecute", () => lCanvas.draw(true))
}
resizeCanvas();
@@ -47,5 +41,10 @@
width: 100%;
height: 100%;
background-color: #333;
> canvas {
// Don't try to scroll the page when scrolling on canvas
touch-action: none;
}
}
</style>