diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-11-12 01:18:46 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-11-12 01:18:46 +0300 |
commit | c29795452cc71cb9f5a571a4aff0f593a2d7acaf (patch) | |
tree | 53a46bb77f3102c545f7e55d3344e310b3bf6116 /source/blender/editors/space_node/drawnode.cc | |
parent | 9980fd0b8e1f3a07060316f28469f55a3f2fc0cd (diff) | |
parent | 03ccf37162d365f3fdc8d8cd0cd6e9ff314fec6e (diff) |
Merge branch 'master' into temp-sculpt-roll-mappingtemp-sculpt-roll-mapping
Diffstat (limited to 'source/blender/editors/space_node/drawnode.cc')
-rw-r--r-- | source/blender/editors/space_node/drawnode.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc index df31a0342cb..c66b8ad4ff0 100644 --- a/source/blender/editors/space_node/drawnode.cc +++ b/source/blender/editors/space_node/drawnode.cc @@ -1581,10 +1581,12 @@ void draw_nodespace_back_pix(const bContext &C, GPU_matrix_pop(); } -static float2 socket_link_connection_location(const bNodeSocket &socket, const bNodeLink &link) +static float2 socket_link_connection_location(const bNode &node, + const bNodeSocket &socket, + const bNodeLink &link) { const float2 socket_location(socket.locx, socket.locy); - if (socket.is_multi_input() && socket.is_input() && !(socket.owner_node().flag & NODE_HIDDEN)) { + if (socket.is_multi_input() && socket.is_input() && !(node.flag & NODE_HIDDEN)) { return node_link_calculate_multi_input_position( socket_location, link.multi_input_socket_index, socket.total_inputs); } @@ -1620,8 +1622,8 @@ static void calculate_inner_link_bezier_points(std::array<float2, 4> &points) static std::array<float2, 4> node_link_bezier_points(const bNodeLink &link) { std::array<float2, 4> points; - points[0] = socket_link_connection_location(*link.fromsock, link); - points[3] = socket_link_connection_location(*link.tosock, link); + points[0] = socket_link_connection_location(*link.fromnode, *link.fromsock, link); + points[3] = socket_link_connection_location(*link.tonode, *link.tosock, link); calculate_inner_link_bezier_points(points); return points; } @@ -2212,8 +2214,11 @@ static std::array<float2, 4> node_link_bezier_points_dragged(const SpaceNode &sn { const float2 cursor = snode.runtime->cursor * UI_DPI_FAC; std::array<float2, 4> points; - points[0] = link.fromsock ? socket_link_connection_location(*link.fromsock, link) : cursor; - points[3] = link.tosock ? socket_link_connection_location(*link.tosock, link) : cursor; + points[0] = link.fromsock ? + socket_link_connection_location(*link.fromnode, *link.fromsock, link) : + cursor; + points[3] = link.tosock ? socket_link_connection_location(*link.tonode, *link.tosock, link) : + cursor; calculate_inner_link_bezier_points(points); return points; } |