[Bf-blender-cvs] [c9bd61b3724] blender2.8: UI: Fix nodelink not touching inputs when noodle_curving is 0

Clément Foucault noreply at git.blender.org
Fri Aug 10 16:20:49 CEST 2018


Commit: c9bd61b37240ad000ae7ac4d49801e4afe3565b0
Author: Clément Foucault
Date:   Fri Aug 10 14:24:31 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc9bd61b37240ad000ae7ac4d49801e4afe3565b0

UI: Fix nodelink not touching inputs when noodle_curving is 0

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

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

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

diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index a48a6faf69f..4dfbb92971b 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -3353,7 +3353,16 @@ static bool node_link_bezier_handles(View2D *v2d, SpaceNode *snode, bNodeLink *l
 	}
 
 	/* may be called outside of drawing (so pass spacetype) */
-	dist = UI_GetThemeValueType(TH_NODE_CURVING, SPACE_NODE) * 0.10f * fabsf(vec[0][0] - vec[3][0]);
+	int curving = UI_GetThemeValueType(TH_NODE_CURVING, SPACE_NODE);
+
+	if (curving == 0) {
+		/* Straight line: align all points. */
+		mid_v2_v2v2(vec[1], vec[0], vec[3]);
+		mid_v2_v2v2(vec[2], vec[1], vec[3]);
+		return 1;
+	}
+
+	dist = curving * 0.10f * fabsf(vec[0][0] - vec[3][0]);
 	deltax = vec[3][0] - vec[0][0];
 	deltay = vec[3][1] - vec[0][1];
 	/* check direction later, for top sockets */



More information about the Bf-blender-cvs mailing list