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:
authorGermano Cavalcante <germano.costa@ig.com.br>2021-01-28 15:48:53 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-01-30 16:46:05 +0300
commit036b65d778c16a6bdf80598ff589f748a06e0670 (patch)
tree3e4dcc5942d7008642762bdd0aafa8ae6dec1a0a /source/blender
parentd0f59d38429d945b3215890897eb2cfb90eacaa7 (diff)
Fix T85149: Wrong reroute position when adding with quick gesture
In the operation of adding reroute node to the intersection with the gesture segment, each rerount was added to the middle of two points that are part of the segment. Now add the reroute point to the intersection position. Maniphest Tasks: T85149 Differential Revision: https://developer.blender.org/D10247
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_node/node_add.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/node_add.c b/source/blender/editors/space_node/node_add.c
index 131bacbdfef..e665f7b1d52 100644
--- a/source/blender/editors/space_node/node_add.c
+++ b/source/blender/editors/space_node/node_add.c
@@ -104,9 +104,8 @@ static bool add_reroute_intersect_check(bNodeLink *link,
if (node_link_bezier_points(NULL, NULL, 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) {
- result[0] = (mcoords[i][0] + mcoords[i + 1][0]) / 2.0f;
- result[1] = (mcoords[i][1] + mcoords[i + 1][1]) / 2.0f;
+ if (isect_seg_seg_v2_point(
+ mcoords[i], mcoords[i + 1], coord_array[b], coord_array[b + 1], result) > 0) {
return true;
}
}