VSE: draw grid lines at every second
authorCampbell Barton <ideasman42@gmail.com>
Mon, 23 Oct 2017 11:27:21 +0000 (22:27 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 23 Oct 2017 11:29:49 +0000 (22:29 +1100)
Was hard-coded to 25 frames.

D2893 by @jooert

source/blender/editors/include/UI_view2d.h
source/blender/editors/interface/view2d.c
source/blender/editors/space_sequencer/sequencer_draw.c

index 4c0493a881c6ce9128f533920bd87c844fe98143..f6e31e0bd22a410e84f114af025f03ac21c7cf52 100644 (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);
index c704c4ae1267e487f55cded8cf857b753dd55860..38432395a17dc30312a9d7e5b00cd01cf7824624 100644 (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);
        
index 97961501c6d03e346b58b0df5c131ec9ee651286..160aa1571896877071cf0d982d4453946e09096a 100644 (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) {