VSE: draw grid lines at every second

Was hard-coded to 25 frames.

D2893 by @jooert
This commit is contained in:
Campbell Barton 2017-10-23 22:27:21 +11:00
parent 1aa5b63661
commit cc96cdd9d4
Notes: blender-bot 2023-02-14 07:39:44 +01:00
Referenced by issue #53145, Bevel Problem
3 changed files with 5 additions and 6 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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) {