diff options
author | Hans Goudey <h.goudey@me.com> | 2020-08-14 04:33:47 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-08-14 04:33:47 +0300 |
commit | 0ab21bf06ae021539c91d24d772813b6132ba382 (patch) | |
tree | d39e4e539f58e8d45e834592b660847992c7604b /source/blender/editors/interface/interface_draw.c | |
parent | 570044e9f412d37fbf1523652034afe5d87a3d4e (diff) |
UI Code Quality: Use derived struct for curve mapping buttons
The same changes as in rB570044e9f412.
Diffstat (limited to 'source/blender/editors/interface/interface_draw.c')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index aad3b4d15a1..1ed43697cd1 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1888,14 +1888,9 @@ static void gl_shaded_color(const uchar *color, int shade) void ui_draw_but_CURVE(ARegion *region, uiBut *but, const uiWidgetColors *wcol, const rcti *rect) { - CurveMapping *cumap; - - if (but->editcumap) { - cumap = but->editcumap; - } - else { - cumap = (CurveMapping *)but->poin; - } + uiButCurveMapping *but_cumap = (uiButCurveMapping *)but; + CurveMapping *cumap = (but_cumap->edit_cumap == NULL) ? (CurveMapping *)but->poin : + but_cumap->edit_cumap; float clip_size_x = BLI_rctf_size_x(&cumap->curr); float clip_size_y = BLI_rctf_size_y(&cumap->curr); |