Fix: correct offset for internal multi-input link

Pull Request: https://projects.blender.org/blender/blender/pulls/109776
This commit is contained in:
Iliya Katueshenock
2024-05-26 13:37:52 +02:00
committed by Jacques Lucke
parent 03bcd70cd1
commit 4fc8a72780

View File

@@ -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<int>(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;
}