[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38328] branches/soc-2011-pepper/source/ blender/editors: Timeline Drawing - Time cursor draws extra wide in timeline so that

Joshua Leung aligorith at gmail.com
Tue Jul 12 14:13:24 CEST 2011


Revision: 38328
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38328
Author:   aligorith
Date:     2011-07-12 12:13:23 +0000 (Tue, 12 Jul 2011)
Log Message:
-----------
Timeline Drawing - Time cursor draws extra wide in timeline so that
keyframe lines are wrapped up nicely by it

Ideally it could be made so that it only became wide when it is on a
frame with a keyframe, though that could end up causing performance
problems, so this will have to do (if a bit "chunky" looking at
times).

Modified Paths:
--------------
    branches/soc-2011-pepper/source/blender/editors/animation/anim_draw.c
    branches/soc-2011-pepper/source/blender/editors/include/ED_anim_api.h
    branches/soc-2011-pepper/source/blender/editors/space_time/space_time.c

Modified: branches/soc-2011-pepper/source/blender/editors/animation/anim_draw.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/animation/anim_draw.c	2011-07-12 12:04:27 UTC (rev 38327)
+++ branches/soc-2011-pepper/source/blender/editors/animation/anim_draw.c	2011-07-12 12:13:23 UTC (rev 38328)
@@ -225,7 +225,10 @@
 	vec[0]= (float)(scene->r.cfra * scene->r.framelen);
 	
 	UI_ThemeColor(TH_CFRAME);
-	glLineWidth(2.0);
+	if (flag & DRAWCFRA_WIDE)
+		glLineWidth(3.0);
+	else
+		glLineWidth(2.0);
 	
 	glBegin(GL_LINE_STRIP);
 		vec[1]= v2d->cur.ymin-500.0f;	/* XXX arbitrary... want it go to bottom */

Modified: branches/soc-2011-pepper/source/blender/editors/include/ED_anim_api.h
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/include/ED_anim_api.h	2011-07-12 12:04:27 UTC (rev 38327)
+++ branches/soc-2011-pepper/source/blender/editors/include/ED_anim_api.h	2011-07-12 12:13:23 UTC (rev 38328)
@@ -458,7 +458,9 @@
 		/* time indication in seconds or frames */
 	DRAWCFRA_UNIT_SECONDS 	= (1<<1),
 		/* show time-offset line */
-	DRAWCFRA_SHOW_TIMEOFS	= (1<<2)
+	DRAWCFRA_SHOW_TIMEOFS	= (1<<2),
+		/* draw indicator extra wide (for timeline) */
+	DRAWCFRA_WIDE			= (1<<3)
 } eAnimEditDraw_CurrentFrame; 
 
 /* main call to draw current-frame indicator in an Animation Editor */

Modified: branches/soc-2011-pepper/source/blender/editors/space_time/space_time.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/space_time/space_time.c	2011-07-12 12:04:27 UTC (rev 38327)
+++ branches/soc-2011-pepper/source/blender/editors/space_time/space_time.c	2011-07-12 12:13:23 UTC (rev 38328)
@@ -472,6 +472,7 @@
 	time_draw_sfra_efra(scene, v2d);
 	
 	/* current frame */
+	flag = DRAWCFRA_WIDE; /* this is only really needed on frames where there's a keyframe, but this will do... */
 	if ((stime->flag & TIME_DRAWFRAMES)==0) 	flag |= DRAWCFRA_UNIT_SECONDS;
 	if (stime->flag & TIME_CFRA_NUM) 			flag |= DRAWCFRA_SHOW_NUMBOX;
 	ANIM_draw_cfra(C, v2d, flag);




More information about the Bf-blender-cvs mailing list