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:
Diffstat (limited to 'source/blender/editors/space_nla/space_nla.c')
-rw-r--r--source/blender/editors/space_nla/space_nla.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
index 6c5a046a0cb..b054f550c6c 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -231,9 +231,8 @@ static void nla_main_region_draw(const bContext *C, ARegion *ar)
Scene *scene = CTX_data_scene(C);
bAnimContext ac;
View2D *v2d = &ar->v2d;
- View2DGrid *grid;
View2DScrollers *scrollers;
- short unit = 0, cfra_flag = 0;
+ short cfra_flag = 0;
/* clear and setup matrix */
UI_ThemeClearColor(TH_BACK);
@@ -242,16 +241,7 @@ static void nla_main_region_draw(const bContext *C, ARegion *ar)
UI_view2d_view_ortho(v2d);
/* time grid */
- unit = (snla->flag & SNLA_DRAWTIME) ? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES;
- grid = UI_view2d_grid_calc(CTX_data_scene(C),
- v2d,
- unit,
- V2D_GRID_CLAMP,
- V2D_ARG_DUMMY,
- V2D_ARG_DUMMY,
- ar->winx,
- ar->winy);
- UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL);
+ UI_view2d_draw_lines_x__discrete_frames_or_seconds(v2d, scene, snla->flag & SNLA_DRAWTIME);
ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW);
@@ -300,8 +290,8 @@ static void nla_main_region_draw(const bContext *C, ARegion *ar)
UI_view2d_scrollers_free(scrollers);
/* frame numbers */
- UI_view2d_grid_draw_numbers_horizontal(scene, v2d, grid, &v2d->hor, unit, true);
- UI_view2d_grid_free(grid);
+ UI_view2d_draw_scale_x__discrete_frames_or_seconds(
+ ar, v2d, &v2d->hor, scene, snla->flag & SNLA_DRAWTIME);
/* draw current frame number-indicator on top of scrollers */
if ((snla->flag & SNLA_NODRAWCFRANUM) == 0) {