This commit is contained in:
release-bot
2026-02-08 22:56:41 +01:00
parent 72d6cd6ea2
commit c7f808ce2d
14 changed files with 193 additions and 113 deletions

View File

@@ -186,15 +186,21 @@ export class GraphState {
if (!node?.inputs) {
return 5;
}
const height = 5
+ 10
* Object.keys(node.inputs).filter(
(p) =>
p !== 'seed'
&& node?.inputs
&& !(node?.inputs?.[p] !== undefined && 'setting' in node.inputs[p])
&& node.inputs[p].hidden !== true
).length;
let height = 5;
for (const key of Object.keys(node.inputs)) {
if (key === 'seed') continue;
if (!node.inputs) continue;
if (node?.inputs?.[key] === undefined) continue;
if ('setting' in node.inputs[key]) continue;
if (node.inputs[key].hidden) continue;
if (node.inputs[key].type === 'shape') {
height += 20;
continue;
}
height += 10;
}
this.nodeHeightCache[nodeTypeId] = height;
return height;
}

View File

@@ -166,15 +166,14 @@ export class MouseEventManager {
if (this.state.mouseDown) return;
this.state.edgeEndPosition = null;
const target = event.target as HTMLElement;
if (event.target instanceof HTMLElement) {
if (
event.target.nodeName !== 'CANVAS'
&& !event.target.classList.contains('node')
&& !event.target.classList.contains('content')
) {
return;
}
if (
target.nodeName !== 'CANVAS'
&& !target.classList.contains('node')
&& !target.classList.contains('content')
) {
return;
}
const mx = event.clientX - this.state.rect.x;

View File

@@ -18,6 +18,7 @@
const inputType = $derived(node?.state?.type?.inputs?.[id]);
const socketId = $derived(`${node.id}-${id}`);
const height = $derived(input.type === 'shape' ? 200 : 100);
const graphState = getGraphState();
const graphId = graph?.id;
@@ -64,6 +65,7 @@
class="wrapper"
data-node-type={node.type}
data-node-input={id}
style:height="{height}px"
class:possible-socket={graphState?.possibleSocketIds.has(socketId)}
>
{#key id && graphId}
@@ -95,8 +97,6 @@
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 100"
width="100"
height="100"
preserveAspectRatio="none"
style={`
--path: path("${path}");
@@ -111,7 +111,6 @@
.wrapper {
position: relative;
width: 100%;
height: 100px;
transform: translateY(-0.5px);
}