From 68640c0a3cf3e33124965126923904b650ff5968 Mon Sep 17 00:00:00 2001 From: JohannesItten Date: Tue, 7 Jul 2026 23:45:46 +0300 Subject: [PATCH] Handles fix --- src/components/nodes/StudioNode.vue | 112 +++++++++++++++++++++++----- 1 file changed, 95 insertions(+), 17 deletions(-) diff --git a/src/components/nodes/StudioNode.vue b/src/components/nodes/StudioNode.vue index dea6115..9f68a76 100644 --- a/src/components/nodes/StudioNode.vue +++ b/src/components/nodes/StudioNode.vue @@ -8,7 +8,6 @@ import { NODE_TYPES } from '../../nodeTypes' const props = defineProps>() const typeDef = computed(() => NODE_TYPES[props.data.nodeType] ?? null) - const inputs = computed(() => typeDef.value?.ports.filter(p => p.direction === 'in') ?? []) const outputs = computed(() => typeDef.value?.ports.filter(p => p.direction === 'out') ?? []) @@ -21,22 +20,37 @@ const stateBadge = computed(() => { } }) -// Update a param value; Vue Flow tracks node data reactively +// Fixed layout constants (keep in sync with CSS) +const HEADER_H = 36 // px — node-header height +const PORT_H = 26 // px — port-row height + +// Handle is centered on its port row +function handleTopPx(index: number): string { + return `${HEADER_H + PORT_H * index + PORT_H / 2}px` +} + function setParam(key: string, value: string | number) { props.data.params[key] = value }