UI Code Quality: Use derived struct for curve profile buttons

Continuing the work from rB49f088e2d093.

Differential Revision: https://developer.blender.org/D8561
This commit is contained in:
2020-08-13 21:00:54 -04:00
parent 275f1039d2
commit 570044e9f4
4 changed files with 36 additions and 14 deletions

View File

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