Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/node_add.cc
| Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | |||||
| /** \name Add Reroute Operator | /** \name Add Reroute Operator | ||||
| * \{ */ | * \{ */ | ||||
| static bool add_reroute_intersect_check(const bNodeLink &link, | static bool add_reroute_intersect_check(const bNodeLink &link, | ||||
| float mcoords[][2], | float mcoords[][2], | ||||
| int tot, | int tot, | ||||
| float result[2]) | float result[2]) | ||||
| { | { | ||||
| float coord_array[NODE_LINK_RESOL + 1][2]; | std::array<float2, NODE_LINK_RESOL + 1> coord_array; | ||||
| if (node_link_bezier_points(nullptr, nullptr, link, coord_array, NODE_LINK_RESOL)) { | if (node_link_bezier_points(nullptr, nullptr, link, coord_array, NODE_LINK_RESOL)) { | ||||
| for (int i = 0; i < tot - 1; i++) { | for (int i = 0; i < tot - 1; i++) { | ||||
| for (int b = 0; b < NODE_LINK_RESOL; b++) { | for (int b = 0; b < NODE_LINK_RESOL; b++) { | ||||
| if (isect_seg_seg_v2_point( | if (isect_seg_seg_v2_point( | ||||
| mcoords[i], mcoords[i + 1], coord_array[b], coord_array[b + 1], result) > 0) { | mcoords[i], mcoords[i + 1], coord_array[b], coord_array[b + 1], result) > 0) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 939 Lines • Show Last 20 Lines | |||||