From b05fd95f8aaf3eecb88dbb87744fec7bda30fa1f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 24 Apr 2018 19:18:22 +0200 Subject: Current Frame Indicator tweaks * Draw the frame/time number box over the scrollbar instead of above it, to reduce the clutter/clashes with markers. * Draw the box centered around the line instead of off to one side, making it clearer that the frame shown is the one being affected. * Make the box larger than the scrollbar + use white text to make it stand out from the neighbouring frame numbers (otherwise, it's easy to misread that it's just another one of those) --- source/blender/editors/space_nla/space_nla.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/space_nla') diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 616d85f7d9d..331fae606af 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -274,7 +274,7 @@ static void nla_main_region_draw(const bContext *C, ARegion *ar) View2D *v2d = &ar->v2d; View2DGrid *grid; View2DScrollers *scrollers; - short unit = 0, flag = 0; + short unit = 0, cfra_flag = 0; /* clear and setup matrix */ UI_ThemeClearColor(TH_BACK); @@ -305,9 +305,8 @@ static void nla_main_region_draw(const bContext *C, ARegion *ar) UI_view2d_view_ortho(v2d); /* current frame */ - if (snla->flag & SNLA_DRAWTIME) flag |= DRAWCFRA_UNIT_SECONDS; - if ((snla->flag & SNLA_NODRAWCFRANUM) == 0) flag |= DRAWCFRA_SHOW_NUMBOX; - ANIM_draw_cfra(C, v2d, flag); + if (snla->flag & SNLA_DRAWTIME) cfra_flag |= DRAWCFRA_UNIT_SECONDS; + ANIM_draw_cfra(C, v2d, cfra_flag); /* markers */ UI_view2d_view_orthoSpecial(ar, v2d, 1); @@ -328,6 +327,12 @@ static void nla_main_region_draw(const bContext *C, ARegion *ar) scrollers = UI_view2d_scrollers_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); UI_view2d_scrollers_draw(C, v2d, scrollers); UI_view2d_scrollers_free(scrollers); + + /* draw current frame number-indicator on top of scrollers */ + if ((snla->flag & SNLA_NODRAWCFRANUM) == 0) { + UI_view2d_view_orthoSpecial(ar, v2d, 1); + ANIM_draw_cfra_number(C, v2d, cfra_flag); + } } -- cgit v1.2.3