[Bf-blender-cvs] [036b65d778c] master: Fix T85149: Wrong reroute position when adding with quick gesture

Germano Cavalcante noreply at git.blender.org
Sat Jan 30 14:46:35 CET 2021


Commit: 036b65d778c16a6bdf80598ff589f748a06e0670
Author: Germano Cavalcante
Date:   Thu Jan 28 09:48:53 2021 -0300
Branches: master
https://developer.blender.org/rB036b65d778c16a6bdf80598ff589f748a06e0670

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

===================================================================

M	source/blender/editors/space_node/node_add.c

===================================================================

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;
         }
       }



More information about the Bf-blender-cvs mailing list