diff options
author | Hans Goudey <h.goudey@me.com> | 2020-09-04 18:56:56 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-09-04 18:56:56 +0300 |
commit | 417695e4a8bff7927a936797ca01c6461ce0eaf7 (patch) | |
tree | 1d7a1ff4b95d09bbb6319f4378520e43f170e6ac /source/blender/editors/interface/interface_handlers.c | |
parent | ce67a9d39f0feef89bbb9f7835b52884921e66ed (diff) |
Curve Profile: Miscellaneous cleanup
- Declare variables where they are initialized
- Use consistent variable and static function names
- Use helper functions more for common operations
- Remove use of BezTriple struct, use CurveProfilePoint instead
- Apply small simplifications to code in some situations
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index bf38f8bf12f..83cbdeff0d8 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -6954,10 +6954,7 @@ static bool ui_numedit_but_CURVEPROFILE(uiBlock *block, const float zoomy = BLI_rctf_size_y(&but->rect) / BLI_rctf_size_y(&profile->view_rect); if (snap) { - float d[2]; - - d[0] = mx - data->dragstartx; - d[1] = my - data->dragstarty; + float d[2] = {mx - data->dragstartx, data->dragstarty}; if (len_squared_v2(d) < (9.0f * U.dpi_fac)) { snap = false; @@ -6979,7 +6976,7 @@ static bool ui_numedit_but_CURVEPROFILE(uiBlock *block, const float delta[2] = {fx, fy}; for (int a = 0; a < profile->path_len; a++) { /* Don't move the last and first control points. */ - if ((pts[a].flag & PROF_SELECT) && (a != 0) && (a != profile->path_len)) { + if (pts[a].flag & PROF_SELECT) { moved_point |= BKE_curveprofile_move_point(profile, &pts[a], snap, delta); last_x = pts[a].x; last_y = pts[a].y; |