Fix Knife bug T39617: midpoint snap should affect intermediate points.
authorHoward Trickey <howard.trickey@gmail.com>
Wed, 16 Apr 2014 18:17:30 +0000 (14:17 -0400)
committerHoward Trickey <howard.trickey@gmail.com>
Wed, 16 Apr 2014 18:19:36 +0000 (14:19 -0400)
This reverts to the 2.69 behavior, where the snap-to-midpoint option
affected the intermediate crossed edges as well as the endpoints.

source/blender/editors/mesh/editmesh_knife.c

index 1fcff82c2a254038baa759b6edb4029fc8988d3b..d973523437d8a75aeb1af8c7c5f724b9329c7abf 100644 (file)
@@ -1395,6 +1395,12 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd)
                                isect_kind = isect_line_line_v3(kfe->v1->cageco, kfe->v2->cageco, r1, r2, p, p2);
                                if (isect_kind >= 1 && point_is_visible(kcd, p, sint, &mats)) {
                                        memset(&hit, 0, sizeof(hit));
+                                       if (kcd->snap_midpoints) {
+                                               /* choose intermediate point snap too */
+                                               mid_v3_v3v3(p, kfe->v1->cageco, kfe->v2->cageco);
+                                               mid_v2_v2v2(sint, se1, se2);
+                                               lambda = 0.5f;
+                                       }
                                        hit.kfe = kfe;
                                        copy_v3_v3(hit.hit, p);
                                        copy_v3_v3(hit.cagehit, p);