fix link direction for widget slots.

This commit is contained in:
Codes4Fun
2026-06-20 07:43:23 -07:00
parent 1f103f0d39
commit cf42d57cf5
+4 -1
View File
@@ -106,12 +106,15 @@ function getLinkTargetSlot(graph, link) {
function getSlotPos(slot, isInput) {
// sugraph io has pos
if (slot.pos)
if (!slot.node)
return slot.pos;
// we don't have access to slot pos stores, so simple calculation
const node = slot.node;
let x = node.pos[0];
let y = node.pos[1];
if (!node.flags?.collapsed && slot.pos) {
return [x+slot.pos[0],y+slot.pos[1]];
}
if (node.flags?.collapsed) {
y -= LiteGraph.NODE_TITLE_HEIGHT;
}