Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_node/node_edit.cc')
-rw-r--r--source/blender/editors/space_node/node_edit.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc
index 5a598a1bd04..3bce32e7af4 100644
--- a/source/blender/editors/space_node/node_edit.cc
+++ b/source/blender/editors/space_node/node_edit.cc
@@ -111,15 +111,14 @@ float node_socket_calculate_height(const bNodeSocket &socket)
return sock_height;
}
-void node_link_calculate_multi_input_position(const float socket_x,
- const float socket_y,
- const int index,
- const int total_inputs,
- float r[2])
-{
- float offset = (total_inputs * NODE_MULTI_INPUT_LINK_GAP - NODE_MULTI_INPUT_LINK_GAP) * 0.5;
- r[0] = socket_x - NODE_SOCKSIZE * 0.5f;
- r[1] = socket_y - offset + (index * NODE_MULTI_INPUT_LINK_GAP);
+float2 node_link_calculate_multi_input_position(const float2 &socket_position,
+ const int index,
+ const int total_inputs)
+{
+ const float offset = (total_inputs * NODE_MULTI_INPUT_LINK_GAP - NODE_MULTI_INPUT_LINK_GAP) *
+ 0.5f;
+ return {socket_position.x - NODE_SOCKSIZE * 0.5f,
+ socket_position.y - offset + index * NODE_MULTI_INPUT_LINK_GAP};
}
static void compo_tag_output_nodes(bNodeTree *nodetree, int recalc_flags)