Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2018-04-24 20:18:22 +0300
committerJoshua Leung <aligorith@gmail.com>2018-04-24 20:18:31 +0300
commitb05fd95f8aaf3eecb88dbb87744fec7bda30fa1f (patch)
treeba86fc0063cd639954a85ea4724946a2fd2cafcf /source/blender/editors/space_nla
parent9511cc13d75a156743bf55a73d5c7fc8f56fe72b (diff)
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)
Diffstat (limited to 'source/blender/editors/space_nla')
-rw-r--r--source/blender/editors/space_nla/space_nla.c13
1 files changed, 9 insertions, 4 deletions
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);
+ }
}