[Bf-blender-cvs] [cc96cdd9d49] master: VSE: draw grid lines at every second

Campbell Barton noreply at git.blender.org
Mon Oct 23 13:26:57 CEST 2017


Commit: cc96cdd9d49c6029e2abc62d81556e2f22480438
Author: Campbell Barton
Date:   Mon Oct 23 22:27:21 2017 +1100
Branches: master
https://developer.blender.org/rBcc96cdd9d49c6029e2abc62d81556e2f22480438

VSE: draw grid lines at every second

Was hard-coded to 25 frames.

D2893 by @jooert

===================================================================

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

===================================================================

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



More information about the Bf-blender-cvs mailing list