feat: some stuff

This commit is contained in:
2024-04-05 19:38:10 +02:00
parent b3780fdf96
commit 0ecf9798c4
22 changed files with 157 additions and 66 deletions

View File

@ -111,7 +111,8 @@
if (!node?.inputs) {
return 5;
}
const height = 5 + 10 * Object.keys(node.inputs).length;
const height =
5 + 10 * Object.keys(node.inputs).filter((i) => i !== "seed").length;
nodeHeightCache[nodeTypeId] = height;
return height;
}
@ -385,6 +386,17 @@
function handleMouseDown(event: MouseEvent) {
if (mouseDown) return;
if (event.target instanceof HTMLElement) {
if (
event.target.nodeName !== "CANVAS" &&
!event.target.classList.contains("node") &&
!event.target.classList.contains("content")
) {
return;
}
}
mouseDown = [event.clientX, event.clientY];
cameraDown[0] = cameraPosition[0];
cameraDown[1] = cameraPosition[1];

View File

@ -23,7 +23,9 @@
const type = node?.tmp?.type;
const parameters = Object.entries(type?.inputs || {});
const parameters = Object.entries(type?.inputs || {}).filter(
(p) => p[1].type !== "seed",
);
let ref: HTMLDivElement;
let meshRef: Mesh;

View File

@ -71,7 +71,7 @@
{#key id && graphId}
{#if node?.tmp?.type?.inputs?.[id]?.external !== true}
<div class="content" class:disabled={$inputSockets.has(socketId)}>
<NodeInput {node} {input} {id} label={input.title} />
<NodeInput {node} {input} {id} label={input.label} />
</div>
{/if}