From cc96cdd9d49c6029e2abc62d81556e2f22480438 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 23 Oct 2017 22:27:21 +1100 Subject: [PATCH] VSE: draw grid lines at every second Was hard-coded to 25 frames. D2893 by @jooert --- source/blender/editors/include/UI_view2d.h | 2 +- source/blender/editors/interface/view2d.c | 4 ++-- source/blender/editors/space_sequencer/sequencer_draw.c | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index 4c0493a881c..f6e31e0bd22 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -169,7 +169,7 @@ void UI_view2d_view_restore(const struct bContext *C); View2DGrid *UI_view2d_grid_calc(struct Scene *scene, struct View2D *v2d, short xunits, short xclamp, short yunits, short yclamp, int winx, int winy); void UI_view2d_grid_draw(struct View2D *v2d, View2DGrid *grid, int flag); -void UI_view2d_constant_grid_draw(struct View2D *v2d); +void UI_view2d_constant_grid_draw(struct View2D *v2d, float step); void UI_view2d_multi_grid_draw(struct View2D *v2d, int colorid, float step, int level_size, int totlevels); void UI_view2d_grid_size(View2DGrid *grid, float *r_dx, float *r_dy); void UI_view2d_grid_free(View2DGrid *grid); diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index c704c4ae126..38432395a17 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1395,9 +1395,9 @@ void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag) } /* Draw a constant grid in given 2d-region */ -void UI_view2d_constant_grid_draw(View2D *v2d) +void UI_view2d_constant_grid_draw(View2D *v2d, float step) { - float start, step = 25.0f; + float start; UI_ThemeColorShade(TH_BACK, -10); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 97961501c6d..160aa157189 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1630,9 +1630,8 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) /* draw backdrop */ draw_seq_backdrop(v2d); - /* regular grid-pattern over the rest of the view (i.e. 25-frame grid lines) */ - // NOTE: the gridlines are currently spaced every 25 frames, which is only fine for 25 fps, but maybe not for 30... - UI_view2d_constant_grid_draw(v2d); + /* regular grid-pattern over the rest of the view (i.e. 1-second grid lines) */ + UI_view2d_constant_grid_draw(v2d, FPS); /* Only draw backdrop in pure sequence view. */ if (sseq->view == SEQ_VIEW_SEQUENCE && sseq->draw_flag & SEQ_DRAW_BACKDROP) {