diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-07-12 16:04:27 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-07-12 16:04:27 +0400 |
commit | 7dd6926b22c77b4d77f64eccb7b8d4dab4dd5a7d (patch) | |
tree | 84a30692d22edd72f43f60b40c7bcfec89505a28 /source/blender/editors/space_time | |
parent | 8d78e10b69313eba178acf4e010c6709a3dbe1a9 (diff) |
Bugfix [#27548] Timeline view - 2D drawing issues
* Keyframe lines were being drawn too short when frame number box was
enabled. The code for drawing this was modifying the View2D view-space
to get it's stuff in the right place, but the timeline code was not
accounting for this.
* In order to make the time ticks more visible outside the frame
range, I've moved the start/end frame drawing stuff in timeline to
occur after the grid drawing, and to draw semi-transparent, just like
the preview range curtains in the other animation editors
Diffstat (limited to 'source/blender/editors/space_time')
-rw-r--r-- | source/blender/editors/space_time/space_time.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index b4cd4a5abdd..524ff60d48d 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -71,16 +71,20 @@ static void time_draw_sfra_efra(Scene *scene, View2D *v2d) { /* draw darkened area outside of active timeline - * frame range used is preview range or scene range */ - UI_ThemeColorShade(TH_BACK, -25); - - if (PSFRA < PEFRA) { - glRectf(v2d->cur.xmin, v2d->cur.ymin, (float)PSFRA, v2d->cur.ymax); - glRectf((float)PEFRA, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); - } - else { - glRectf(v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); - } + * frame range used is preview range or scene range + */ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glColor4f(0.0f, 0.0f, 0.0f, 0.4f); + + if (PSFRA < PEFRA) { + glRectf(v2d->cur.xmin, v2d->cur.ymin, (float)PSFRA, v2d->cur.ymax); + glRectf((float)PEFRA, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); + } + else { + glRectf(v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax); + } + glDisable(GL_BLEND); UI_ThemeColorShade(TH_BACK, -60); /* thin lines where the actual frames are */ @@ -303,8 +307,8 @@ static void time_draw_idblock_keyframes(View2D *v2d, ID *id, short onlysel) (ak) && (ak->cfra <= v2d->cur.xmax); ak=ak->next ) { - glVertex2f(ak->cfra, v2d->cur.ymin); - glVertex2f(ak->cfra, v2d->cur.ymax); + glVertex2f(ak->cfra, v2d->tot.ymin); + glVertex2f(ak->cfra, v2d->tot.ymax); } glEnd(); // GL_LINES @@ -457,9 +461,6 @@ static void time_main_area_draw(const bContext *C, ARegion *ar) glClear(GL_COLOR_BUFFER_BIT); UI_view2d_view_ortho(v2d); - - /* start and end frame */ - time_draw_sfra_efra(scene, v2d); /* grid */ unit= (stime->flag & TIME_DRAWFRAMES)? V2D_UNIT_FRAMES: V2D_UNIT_SECONDS; @@ -467,11 +468,16 @@ static void time_main_area_draw(const bContext *C, ARegion *ar) UI_view2d_grid_draw(v2d, grid, (V2D_VERTICAL_LINES|V2D_VERTICAL_AXIS)); UI_view2d_grid_free(grid); + /* start and end frame */ + time_draw_sfra_efra(scene, v2d); + /* current frame */ 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); + UI_view2d_view_ortho(v2d); + /* keyframes */ if(!G.rendering) /* ANIM_nla_mapping_apply_fcurve() modifies curve data while rendering, possible race condition */ time_draw_keyframes(C, stime, ar); |