diff options
Diffstat (limited to 'source/blender/editors/space_action/action_draw.c')
-rw-r--r-- | source/blender/editors/space_action/action_draw.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index a3bdcd2adf5..6f1a90e56a5 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -259,17 +259,18 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region else { color = sel ? col1 : col2; } - /* frames less than one get less saturated background */ + + /* Color overlay on frames between the start/end frames. */ immUniformColor4ubv(color); - immRectf(pos, 0.0f, ymin, v2d->cur.xmin, ymax); + immRectf(pos, ac->scene->r.sfra, ymin, ac->scene->r.efra, ymax); - /* frames one and higher get a saturated background */ - immUniformColor3ubvAlpha(color, MIN2(255, color[3] * 2)); - immRectf(pos, v2d->cur.xmin, ymin, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymax); + /* Color overlay outside the start/end frame range get a more transparent overlay. */ + immUniformColor3ubvAlpha(color, MIN2(255, color[3] / 2)); + immRectf(pos, v2d->cur.xmin, ymin, ac->scene->r.sfra, ymax); + immRectf(pos, ac->scene->r.efra, ymin, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymax); } else if (ac->datatype == ANIMCONT_MASK) { /* TODO: this is a copy of gpencil. */ - /* frames less than one get less saturated background */ uchar *color; if (ale->type == ANIMTYPE_SUMMARY) { color = col_summary; @@ -277,12 +278,15 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region else { color = sel ? col1 : col2; } + + /* Color overlay on frames between the start/end frames. */ immUniformColor4ubv(color); - immRectf(pos, 0.0f, ymin, v2d->cur.xmin, ymax); + immRectf(pos, ac->scene->r.sfra, ymin, ac->scene->r.efra, ymax); - /* frames one and higher get a saturated background */ - immUniformColor3ubvAlpha(color, MIN2(255, color[3] * 2)); - immRectf(pos, v2d->cur.xmin, ymin, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymax); + /* Color overlay outside the start/end frame range get a more transparent overlay. */ + immUniformColor3ubvAlpha(color, MIN2(255, color[3] / 2)); + immRectf(pos, v2d->cur.xmin, ymin, ac->scene->r.sfra, ymax); + immRectf(pos, ac->scene->r.efra, ymin, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymax); } } } |