[Bf-blender-cvs] [fae895125e] blender2.8: fix OpenGL line count in VSE backdrop

Mike Erwin noreply at git.blender.org
Sat Feb 18 21:39:49 CET 2017


Commit: fae895125efe1b5c1c9b9280cd0597b9b3b40445
Author: Mike Erwin
Date:   Sat Feb 18 15:39:21 2017 -0500
Branches: blender2.8
https://developer.blender.org/rBfae895125efe1b5c1c9b9280cd0597b9b3b40445

fix OpenGL line count in VSE backdrop

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

M	source/blender/editors/space_sequencer/sequencer_draw.c

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

diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index cd2bdbd289..d13d2be068 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1513,7 +1513,7 @@ static void draw_seq_backdrop(View2D *v2d)
 	i = max_ii(1, ((int)v2d->cur.ymin) - 1);
 
 	while (i < v2d->cur.ymax) {
-		if (((int)i) & 1) {
+		if (i & 1) {
 			immUniformThemeColorShade(TH_BACK, -15);
 		}
 		else {
@@ -1527,14 +1527,12 @@ static void draw_seq_backdrop(View2D *v2d)
 
 	/* Darker lines separating the horizontal bands */
 	i = max_ii(1, ((int)v2d->cur.ymin) - 1);
+	int line_ct = (int)v2d->cur.ymax - i + 1;
 	immUniformThemeColor(TH_GRID);
-	
-	immBegin(GL_LINES, ((int)v2d->cur.ymax - i + 1) * 2);
-	while (i < v2d->cur.ymax) {
+	immBegin(GL_LINES, line_ct * 2);
+	while (line_ct--) {
 		immVertex2f(pos, v2d->cur.xmax, i);
 		immVertex2f(pos, v2d->cur.xmin, i);
-			
-		i++;
 	}
 	immEnd();




More information about the Bf-blender-cvs mailing list