diff options
Diffstat (limited to 'source/blender/editors/curve/editcurve_pen.c')
-rw-r--r-- | source/blender/editors/curve/editcurve_pen.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index 395053d6b1b..f71173f951e 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -1366,12 +1366,10 @@ static bool make_cyclic_if_endpoints(ViewContext *vc, BPoint *sel_bp) { if (sel_bezt || (sel_bp && sel_nu->pntsu > 2)) { - const bool is_bezt_endpoint = (sel_nu->type == CU_BEZIER && - (sel_bezt == sel_nu->bezt || - sel_bezt == sel_nu->bezt + sel_nu->pntsu - 1)); - const bool is_bp_endpoint = (sel_nu->type != CU_BEZIER && - (sel_bp == sel_nu->bp || - sel_bp == sel_nu->bp + sel_nu->pntsu - 1)); + const bool is_bezt_endpoint = ((sel_nu->type == CU_BEZIER) && + ELEM(sel_bezt, sel_nu->bezt, sel_nu->bezt + sel_nu->pntsu - 1)); + const bool is_bp_endpoint = ((sel_nu->type != CU_BEZIER) && + ELEM(sel_bp, sel_nu->bp, sel_nu->bp + sel_nu->pntsu - 1)); if (!(is_bezt_endpoint || is_bp_endpoint)) { return false; } @@ -1388,9 +1386,8 @@ static bool make_cyclic_if_endpoints(ViewContext *vc, if (nu == sel_nu && ((nu->type == CU_BEZIER && bezt != sel_bezt && - (bezt == nu->bezt || bezt == nu->bezt + nu->pntsu - 1) && bezt_idx == 1) || - (nu->type != CU_BEZIER && bp != sel_bp && - (bp == nu->bp || bp == nu->bp + nu->pntsu - 1)))) { + ELEM(bezt, nu->bezt, nu->bezt + nu->pntsu - 1) && bezt_idx == 1) || + (nu->type != CU_BEZIER && bp != sel_bp && ELEM(bp, nu->bp, nu->bp + nu->pntsu - 1)))) { View3D *v3d = vc->v3d; ListBase *nurbs = object_editcurve_get(vc->obedit); curve_toggle_cyclic(v3d, nurbs, 0); |