diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-02 23:25:34 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-02 23:44:05 +0300 |
commit | 40d815dff6515834c1bce40c0a34cc80b39655d5 (patch) | |
tree | 8ee119bb08149bdd1da998db811a96c8b500b77d /source/blender/editors/space_node/node_relationships.cc | |
parent | 21e235afc3e5149223487fc5b5f4076530d6c13c (diff) |
Cleanup: Further split of node link Bezier calculation function
Now dragged handles are handled separately, and the function returns a
statically sized array by value. The functions are also renamed to be
more consistent with curve naming elsewhere in Blender.
Diffstat (limited to 'source/blender/editors/space_node/node_relationships.cc')
-rw-r--r-- | source/blender/editors/space_node/node_relationships.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/editors/space_node/node_relationships.cc b/source/blender/editors/space_node/node_relationships.cc index aac05fb1d25..c1f18e16d70 100644 --- a/source/blender/editors/space_node/node_relationships.cc +++ b/source/blender/editors/space_node/node_relationships.cc @@ -137,8 +137,7 @@ static void pick_input_link_by_link_intersect(const bContext &C, LISTBASE_FOREACH (bNodeLink *, link, &snode->edittree->links) { if (link->tosock == socket) { /* Test if the cursor is near a link. */ - std::array<float2, 4> points; - node_link_bezier_handles(snode, *link, points); + const std::array<float2, 4> points = node_link_bezier_points(*link); std::array<float2, NODE_LINK_RESOL + 1> data; BKE_curve_forward_diff_bezier(points[0].x, @@ -1325,7 +1324,7 @@ static bool node_links_intersect(bNodeLink &link, const float mcoords[][2], int { float coord_array[NODE_LINK_RESOL + 1][2]; - if (node_link_bezier_points(nullptr, link, coord_array, NODE_LINK_RESOL)) { + if (node_link_bezier_points_evaluated(link, coord_array, NODE_LINK_RESOL)) { for (int i = 0; i < tot - 1; i++) { for (int b = 0; b < NODE_LINK_RESOL; b++) { if (isect_seg_seg_v2(mcoords[i], mcoords[i + 1], coord_array[b], coord_array[b + 1]) > 0) { @@ -1965,7 +1964,7 @@ void ED_node_link_intersect_test(ScrArea *area, int test) continue; } - if (node_link_bezier_points(nullptr, *link, coord_array, NODE_LINK_RESOL)) { + if (node_link_bezier_points_evaluated(*link, coord_array, NODE_LINK_RESOL)) { float dist = FLT_MAX; /* loop over link coords to find shortest dist to |