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:
authorMichael Kowalski <makowalski@nvidia.com>2022-09-23 23:56:14 +0300
committerMichael Kowalski <makowalski@nvidia.com>2022-09-23 23:56:14 +0300
commitb2ad97ba97f3e55d1dd463e29ca0b2ec6fe761e1 (patch)
treef94394835c6b731e4e379f4ef48fb78b4af4b9ca /source/blender/editors/curve/editcurve_pen.c
parentb31807c75f0c18c43ac6979e6da57dc9d420167a (diff)
parent7e980f2b8cb96aa6d04dc72899d08473367eeeb9 (diff)
Merge branch 'master' into tmp-usd-alab-v2-T100452tmp-usd-alab-v2-T100452
Diffstat (limited to 'source/blender/editors/curve/editcurve_pen.c')
-rw-r--r--source/blender/editors/curve/editcurve_pen.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c
index 27f4e4fca61..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);
@@ -1532,7 +1529,7 @@ wmKeyMap *curve_pen_modal_keymap(wmKeyConfig *keyconf)
wmKeyMap *keymap = WM_modalkeymap_find(keyconf, "Curve Pen Modal Map");
- /* This function is called for each spacetype, only needs to add map once */
+ /* This function is called for each space-type, only needs to add map once. */
if (keymap && keymap->modal_items) {
return NULL;
}