Fix Knife bug T39617: midpoint snap should affect intermediate points.

This reverts to the 2.69 behavior, where the snap-to-midpoint option
affected the intermediate crossed edges as well as the endpoints.
This commit is contained in:
Howard Trickey 2014-04-16 14:17:30 -04:00
parent 53fd22acb4
commit f2f3ef8692
Notes: blender-bot 2023-02-14 10:50:48 +01:00
Referenced by issue #93816, New knife tool first cut midpoint snap bug
Referenced by issue #40805, Knife Cut Snap Behavior Regressed
Referenced by issue #39760, Crash when editing a 'bone shape' mesh
Referenced by issue #39617, Knife tool doesn't maintain snap to center when holding ctrl button.
1 changed files with 6 additions and 0 deletions

View 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);