From 4fc8a7278048ebdcc6d4fbdc0e7999112bbbab83 Mon Sep 17 00:00:00 2001 From: Iliya Katueshenock Date: Sun, 26 May 2024 13:37:52 +0200 Subject: [PATCH] Fix: correct offset for internal multi-input link Pull Request: https://projects.blender.org/blender/blender/pulls/109776 --- source/blender/editors/space_node/drawnode.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc index ddfa6251f7a..6c482b20a98 100644 --- a/source/blender/editors/space_node/drawnode.cc +++ b/source/blender/editors/space_node/drawnode.cc @@ -1727,8 +1727,10 @@ static float2 socket_link_connection_location(const bNode &node, { const float2 socket_location = socket.runtime->location; if (socket.is_multi_input() && socket.is_input() && !(node.flag & NODE_HIDDEN)) { + /* For internal link case, handle number of links as at least 1. */ + const int clamped_total_inputs = math::max(1, socket.runtime->total_inputs); return node_link_calculate_multi_input_position( - socket_location, link.multi_input_sort_id, socket.runtime->total_inputs); + socket_location, link.multi_input_sort_id, clamped_total_inputs); } return socket_location; }