diff options
author | Hans Goudey <h.goudey@me.com> | 2021-12-07 01:12:46 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-12-07 01:12:46 +0300 |
commit | 78ae587649bb7b3350586e7f2ed68ea67b75d1f0 (patch) | |
tree | 45961ec5bb646e47cf2b723e3a1f61afbf402bcd /source/blender/editors/space_node/drawnode.cc | |
parent | aa23e870ecc9a2542513a016da98cab7e6d7706c (diff) |
Cleanup: Use C++ types for multi input socket sorting
The algorithm used is still quite inefficient, but at least the code
is easier to read and a little bit simpler now.
Diffstat (limited to 'source/blender/editors/space_node/drawnode.cc')
-rw-r--r-- | source/blender/editors/space_node/drawnode.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc index 8bce1248e8e..b3c88dafe91 100644 --- a/source/blender/editors/space_node/drawnode.cc +++ b/source/blender/editors/space_node/drawnode.cc @@ -3529,11 +3529,11 @@ bool node_link_bezier_handles(const View2D *v2d, vec[0][0] = link.fromsock->locx; vec[0][1] = link.fromsock->locy; if (link.fromsock->flag & SOCK_MULTI_INPUT) { - node_link_calculate_multi_input_position(link.fromsock->locx, - link.fromsock->locy, - link.fromsock->total_inputs - 1, - link.fromsock->total_inputs, - vec[0]); + const float2 position = node_link_calculate_multi_input_position( + {link.fromsock->locx, link.fromsock->locy}, + link.fromsock->total_inputs - 1, + link.fromsock->total_inputs); + copy_v2_v2(vec[0], position); } fromreroute = (link.fromnode && link.fromnode->type == NODE_REROUTE); } @@ -3548,11 +3548,11 @@ bool node_link_bezier_handles(const View2D *v2d, vec[3][0] = link.tosock->locx; vec[3][1] = link.tosock->locy; if (!(link.tonode->flag & NODE_HIDDEN) && link.tosock->flag & SOCK_MULTI_INPUT) { - node_link_calculate_multi_input_position(link.tosock->locx, - link.tosock->locy, - link.multi_input_socket_index, - link.tosock->total_inputs, - vec[3]); + const float2 position = node_link_calculate_multi_input_position( + {link.tosock->locx, link.tosock->locy}, + link.multi_input_socket_index, + link.tosock->total_inputs); + copy_v2_v2(vec[3], position); } toreroute = (link.tonode && link.tonode->type == NODE_REROUTE); } |