From fc889615f770f3163cef9768c88050100875807c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 29 Mar 2021 15:45:22 +1100 Subject: Fix vert/edge knife snapping when the cursor wasn't over a face In this case, the cage location was left zeroed which was then projected back onto the screen to find the nearest screen space edge/vertex. This made snapping to the vertex/edge fail in some corner-cases where it was intended to work. --- source/blender/editors/mesh/editmesh_knife.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/editors/mesh') diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 1e6a2c80f91..f0b77f59a5c 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1922,6 +1922,8 @@ static BMFace *knife_find_closest_face(KnifeTool_OpData *kcd, * of a true coordinate on the face. * This just puts a point 1.0f in front of the view. */ add_v3_v3v3(co, origin, ray); + /* Use this value for the cage location too as it's used to find near edges/vertices. */ + copy_v3_v3(cageco, co); } } -- cgit v1.2.3