diff options
author | Hans Goudey <h.goudey@me.com> | 2020-08-14 04:00:54 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-08-14 04:00:54 +0300 |
commit | 570044e9f412d37fbf1523652034afe5d87a3d4e (patch) | |
tree | 0ed5697e4de4e87704862d72e158206dbc4b4864 /source/blender/editors/interface/interface_draw.c | |
parent | 275f1039d22cb0de4862eb3b7bae859cdddce777 (diff) |
UI Code Quality: Use derived struct for curve profile buttons
Continuing the work from rB49f088e2d093.
Differential Revision: https://developer.blender.org/D8561
Diffstat (limited to 'source/blender/editors/interface/interface_draw.c')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 44c3ccccda8..aad3b4d15a1 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -2179,13 +2179,10 @@ void ui_draw_but_CURVEPROFILE(ARegion *region, { uint i; float fx, fy; - CurveProfile *profile; - if (but->editprofile) { - profile = but->editprofile; - } - else { - profile = (CurveProfile *)but->poin; - } + + uiButCurveProfile *but_profile = (uiButCurveProfile *)but; + CurveProfile *profile = (but_profile->edit_profile == NULL) ? (CurveProfile *)but->poin : + but_profile->edit_profile; /* Calculate offset and zoom. */ float zoomx = (BLI_rcti_size_x(rect) - 2.0f) / BLI_rctf_size_x(&profile->view_rect); |