diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-29 07:45:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-29 10:08:57 +0300 |
commit | fc889615f770f3163cef9768c88050100875807c (patch) | |
tree | 2bfbe330a5535b86affa1a8eb39d9ef9457aa6dc /source | |
parent | ab26be8ff7afe2466e784f7461264c628cc47f48 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); } } |