diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-02-23 09:22:47 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-02-23 09:22:47 +0300 |
commit | ce5428cf4aad9224f71347dd9148a80140bd3149 (patch) | |
tree | b1b571249942877743ccc7217a3ffb5e576c4025 /source/blender/editors/space_graph/graph_draw.c | |
parent | ee49a9596c8ebc45d31760d55cd80cef47eb8916 (diff) |
Graph Editor: Tweaking the drawing of the channel colours for F-Curve channels.
I'm not happy with this yet, but it seems a reasonable compromise. There is a commented-out method included here too.
Diffstat (limited to 'source/blender/editors/space_graph/graph_draw.c')
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index c6eefb087f4..414e6704f4a 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -1147,23 +1147,54 @@ void graph_draw_channel_names(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar) gl_round_box(GL_POLYGON, x+offset, yminc, (float)ACHANNEL_NAMEWIDTH, ymaxc, 8); } else { - /* most of the time, only F-Curves are going to be drawn here */ - if (ale->type == ANIMTYPE_FCURVE) { - /* F-Curve channels are colored with whatever color the curve has stored */ - FCurve *fcu= (FCurve *)ale->data; - glColor3fv(fcu->color); - } - else - UI_ThemeColorShade(TH_HEADER, ((indent==0)?20: (indent==1)?-20: -40)); + short shadefac= ((indent==0)?20: (indent==1)?-20: -40); indent += group; offset += 7 * indent; + + /* draw channel backdrop */ + UI_ThemeColorShade(TH_HEADER, shadefac); + glBegin(GL_QUADS); glVertex2f(x+offset, yminc); glVertex2f(x+offset, ymaxc); glVertex2f((float)ACHANNEL_NAMEWIDTH, ymaxc); glVertex2f((float)ACHANNEL_NAMEWIDTH, yminc); glEnd(); + + /* most of the time, only F-Curves are going to be drawn here */ + if (ale->type == ANIMTYPE_FCURVE) { + /* F-Curve channels need to have a special 'color code' box drawn, which is colored with whatever + * color the curve has stored + */ + FCurve *fcu= (FCurve *)ale->data; + glColor3fv(fcu->color); + + // NOTE: only enable the following line for the fading-out gradient + //glShadeModel(GL_SMOOTH); + + glBegin(GL_QUADS); + /* solid color for the area around the checkbox */ + glVertex2f(x+offset, yminc); + glVertex2f(x+offset, ymaxc); + glVertex2f(x+offset+18, ymaxc); + glVertex2f(x+offset+18, yminc); + +#if 0 // fading out gradient + /* fading out gradient for the rest of the box */ + glVertex2f(x+offset+18, yminc); + glVertex2f(x+offset+18, ymaxc); + + UI_ThemeColorShade(TH_HEADER, shadefac); // XXX does this cause any problems on some cards? + + glVertex2f(x+offset+20, ymaxc); + glVertex2f(x+offset+20, yminc); +#endif // fading out gradient + glEnd(); + + // NOTE: only enable the following line for the fading-out gradient + //glShadeModel(GL_FLAT); + } } /* draw expand/collapse triangle */ |