From cd179b5048c927781401397c8cbd71dfb3ef6766 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 13 Aug 2020 22:00:50 -0400 Subject: UI Code Quality: Use derived struct for color ramp buttons The same changes as rB570044e9f412 and rB0ab21bf06ae0. --- source/blender/editors/interface/interface_draw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/interface/interface_draw.c') diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 1ed43697cd1..6cd274c8b15 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1639,7 +1639,9 @@ void ui_draw_but_COLORBAND(uiBut *but, const uiWidgetColors *UNUSED(wcol), const struct ColorManagedDisplay *display = ui_block_cm_display_get(but->block); uint pos_id, col_id; - ColorBand *coba = (ColorBand *)(but->editcoba ? but->editcoba : but->poin); + uiButColorBand *but_coba = (uiButColorBand *)but; + ColorBand *coba = (but_coba->edit_coba == NULL) ? (ColorBand *)but->poin : but_coba->edit_coba; + if (coba == NULL) { return; } -- cgit v1.2.3