Timeline Drawing - Time cursor draws extra wide in timeline so that
authorJoshua Leung <aligorith@gmail.com>
Tue, 12 Jul 2011 12:13:23 +0000 (12:13 +0000)
committerJoshua Leung <aligorith@gmail.com>
Tue, 12 Jul 2011 12:13:23 +0000 (12:13 +0000)
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).

source/blender/editors/animation/anim_draw.c
source/blender/editors/include/ED_anim_api.h
source/blender/editors/space_time/space_time.c

index d90279300418919b044d089225df02bc21dd503c..22ab419de2e4bc555ddc55c991b79959af9ec530 100644 (file)
@@ -225,7 +225,10 @@ void ANIM_draw_cfra (const bContext *C, View2D *v2d, short flag)
        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 */
index bd86dcfc82f4f2bac1672457be3ba885fb8de8e3..0b99c2561831b5465446df0b324086ea8f2b8001 100644 (file)
@@ -458,7 +458,9 @@ enum {
                /* 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 */
index 524ff60d48d434cdbb2e8ee43b25c40af49c6c29..09842870dffa7fcae646a35f1d938f423615b7c9 100644 (file)
@@ -472,6 +472,7 @@ static void time_main_area_draw(const bContext *C, ARegion *ar)
        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);