[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19087] branches/blender2.5/blender/source /blender/editors/space_graph/graph_draw.c: Graph Editor: Tweaking the drawing of the channel colours for F-Curve channels.
Joshua Leung
aligorith at gmail.com
Mon Feb 23 07:23:09 CET 2009
Revision: 19087
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19087
Author: aligorith
Date: 2009-02-23 07:22:47 +0100 (Mon, 23 Feb 2009)
Log Message:
-----------
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.
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c
Modified: branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c 2009-02-22 22:00:35 UTC (rev 19086)
+++ branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c 2009-02-23 06:22:47 UTC (rev 19087)
@@ -1147,23 +1147,54 @@
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 */
More information about the Bf-blender-cvs
mailing list