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:
authorCampbell Barton <ideasman42@gmail.com>2020-11-10 08:30:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-11-10 08:30:10 +0300
commit3bb690223504bcb765c473dbcca67efcc81629b9 (patch)
tree8435d00858d856cf5280b3e05501512cf81d722f
parentbff1707aaef367822f4fbb38dbc2477b74e643a4 (diff)
parentb902edae75c7087d08339fdf03d132341df1f277 (diff)
Merge branch 'blender-v2.91-release'
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 0ab1c926189..f45f48e0e32 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -1903,8 +1903,15 @@ static BMFace *knife_find_closest_face(KnifeTool_OpData *kcd,
if (!f) {
if (kcd->is_interactive) {
- /* Try to use back-buffer selection method if ray casting failed. */
- f = EDBM_face_find_nearest(&kcd->vc, &dist);
+ /* Try to use back-buffer selection method if ray casting failed.
+ *
+ * Apply the mouse coordinates to a copy of the view-context
+ * since we don't want to rely on this being set elsewhere. */
+ ViewContext vc = kcd->vc;
+ vc.mval[0] = (int)kcd->curr.mval[0];
+ vc.mval[1] = (int)kcd->curr.mval[1];
+
+ f = EDBM_face_find_nearest(&vc, &dist);
/* cheat for now; just put in the origin instead
* of a true coordinate on the face.