diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_nla/nla_draw.c | 54 |
1 files changed, 16 insertions, 38 deletions
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 4694d8652f6..0c81f461369 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -323,12 +323,19 @@ static void nla_draw_strip_curves(NlaStrip *strip, float yminc, float ymaxc, uin { const float yheight = ymaxc - yminc; - immUniformColor3f(0.7f, 0.7f, 0.7f); - /* draw with AA'd line */ GPU_line_smooth(true); GPU_blend(GPU_BLEND_ALPHA); + /* Fully opaque line on selected strips. */ + if (strip->flag & NLASTRIP_FLAG_SELECT) { + /* TODO: Use theme setting. */ + immUniformColor3f(1.0f, 1.0f, 1.0f); + } + else { + immUniformColor4f(1.0f, 1.0f, 1.0f, 0.5f); + } + /* influence -------------------------- */ if (strip->flag & NLASTRIP_FLAG_USR_INFLUENCE) { FCurve *fcu = BKE_fcurve_find(&strip->fcurves, "influence", 0); @@ -501,7 +508,7 @@ static void nla_draw_strip(SpaceNla *snla, /* strip is in normal track */ UI_draw_roundbox_corner_set(UI_CNR_ALL); /* all corners rounded */ - UI_draw_roundbox_shade_x( + UI_draw_roundbox_4fv( &(const rctf){ .xmin = strip->start, .xmax = strip->end, @@ -509,9 +516,7 @@ static void nla_draw_strip(SpaceNla *snla, .ymax = ymaxc, }, true, - 0.0, - 0.5, - 0.1, + 0.0f, color); /* restore current vertex format & program (roundbox trashes it) */ @@ -545,11 +550,9 @@ static void nla_draw_strip(SpaceNla *snla, /* draw strip outline * - color used here is to indicate active vs non-active */ - if (strip->flag & NLASTRIP_FLAG_ACTIVE) { + if (strip->flag & NLASTRIP_FLAG_ACTIVE | strip->flag & NLASTRIP_FLAG_SELECT) { /* strip should appear 'sunken', so draw a light border around it */ - color[0] = 0.9f; /* FIXME: hardcoded temp-hack colors */ - color[1] = 1.0f; - color[2] = 0.9f; + color[0] = color[1] = color[2] = 1.0f; /* FIXME: hardcoded temp-hack colors */ } else { /* strip should appear to stand out, so draw a dark border around it */ @@ -566,7 +569,7 @@ static void nla_draw_strip(SpaceNla *snla, } else { /* non-muted - draw solid, rounded outline */ - UI_draw_roundbox_shade_x( + UI_draw_roundbox_4fv( &(const rctf){ .xmin = strip->start, .xmax = strip->end, @@ -574,9 +577,7 @@ static void nla_draw_strip(SpaceNla *snla, .ymax = ymaxc, }, false, - 0.0, - 0.0, - 0.1, + 0.0f, color); /* restore current vertex format & program (roundbox trashes it) */ @@ -661,7 +662,7 @@ static void nla_draw_strip_text(AnimData *adt, } /* set text color - if colors (see above) are light, draw black text, otherwise draw white */ - if (strip->flag & (NLASTRIP_FLAG_ACTIVE | NLASTRIP_FLAG_SELECT | NLASTRIP_FLAG_TWEAKUSER)) { + if (strip->flag & (NLASTRIP_FLAG_ACTIVE | NLASTRIP_FLAG_TWEAKUSER)) { col[0] = col[1] = col[2] = 0; } else { @@ -805,29 +806,6 @@ void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *region) immRectf( pos, v2d->cur.xmin, ymin + NLACHANNEL_SKIP, v2d->cur.xmax, ymax - NLACHANNEL_SKIP); - /* draw 'embossed' lines above and below the strip for effect */ - /* white base-lines */ - GPU_line_width(2.0f); - immUniformColor4f(1.0f, 1.0f, 1.0f, 0.3f); - immBegin(GPU_PRIM_LINES, 4); - immVertex2f(pos, v2d->cur.xmin, ymin + NLACHANNEL_SKIP); - immVertex2f(pos, v2d->cur.xmax, ymin + NLACHANNEL_SKIP); - immVertex2f(pos, v2d->cur.xmin, ymax - NLACHANNEL_SKIP); - immVertex2f(pos, v2d->cur.xmax, ymax - NLACHANNEL_SKIP); - immEnd(); - - /* black top-lines */ - GPU_line_width(1.0f); - immUniformColor3f(0.0f, 0.0f, 0.0f); - immBegin(GPU_PRIM_LINES, 4); - immVertex2f(pos, v2d->cur.xmin, ymin + NLACHANNEL_SKIP); - immVertex2f(pos, v2d->cur.xmax, ymin + NLACHANNEL_SKIP); - immVertex2f(pos, v2d->cur.xmin, ymax - NLACHANNEL_SKIP); - immVertex2f(pos, v2d->cur.xmax, ymax - NLACHANNEL_SKIP); - immEnd(); - - /* TODO: these lines but better --^ */ - immUnbindProgram(); /* draw keyframes in the action */ |