diff --git a/source/blender/editors/animation/keyframes_draw.cc b/source/blender/editors/animation/keyframes_draw.cc index 3f64c1eebe8..abe4592a72f 100644 --- a/source/blender/editors/animation/keyframes_draw.cc +++ b/source/blender/editors/animation/keyframes_draw.cc @@ -306,7 +306,7 @@ static void draw_keylist_block_interpolation_line(const DrawKeylistUIData *ctx, box.ymax = ypos + ctx->ipo_size; /* Color for interpolation lines based on their type */ - const float *color; + const float *color = nullptr; constexpr short IPO_FLAGS = ACTKEYBLOCK_FLAG_IPO_OTHER | ACTKEYBLOCK_FLAG_IPO_LINEAR | ACTKEYBLOCK_FLAG_IPO_CONSTANT; @@ -314,16 +314,18 @@ static void draw_keylist_block_interpolation_line(const DrawKeylistUIData *ctx, /* This is a summary line that combines multiple interpolation modes. */ color = ctx->ipo_color_mix; } + else if (ab->block.flag & ACTKEYBLOCK_FLAG_IPO_OTHER) { + color = ctx->ipo_color_other; + } + else if (ab->block.flag & ACTKEYBLOCK_FLAG_IPO_LINEAR) { + color = ctx->ipo_color_linear; + } + else if (ab->block.flag & ACTKEYBLOCK_FLAG_IPO_CONSTANT) { + color = ctx->ipo_color_constant; + } else { - if (ab->block.flag & ACTKEYBLOCK_FLAG_IPO_OTHER) { - color = ctx->ipo_color_other; - } - else if (ab->block.flag & ACTKEYBLOCK_FLAG_IPO_LINEAR) { - color = ctx->ipo_color_linear; - } - else if (ab->block.flag & ACTKEYBLOCK_FLAG_IPO_CONSTANT) { - color = ctx->ipo_color_constant; - } + /* No line to draw. */ + return; } UI_draw_roundbox_4fv(&box, true, 3.0f, color);