Commit: 165bdfb6721e153e40f0c85d4e7b7b9f012a9704
Author: Dalai Felinto
Date:   Thu Oct 13 02:19:04 2016 +0000
Branches: blender2.8
https://developer.blender.org/rB165bdfb6721e153e40f0c85d4e7b7b9f012a9704

Fix timeline break after recent immediate mode change (rBf6e7e46f)

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

M       source/blender/editors/space_time/space_time.c

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

diff --git a/source/blender/editors/space_time/space_time.c 
b/source/blender/editors/space_time/space_time.c
index 0b249bf..8b54d26 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -212,23 +212,26 @@ static void time_draw_idblock_keyframes(View2D *v2d, ID 
*id, short onlysel, cons
                max_len++;
        }
 
-       VertexFormat *format = immVertexFormat();
-       unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
+       if (max_len > 0) {
 
-       immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
-       immUniformColor3ubv(color);
+               VertexFormat *format = immVertexFormat();
+               unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, 
KEEP_FLOAT);
 
-       immBeginAtMost(GL_LINES, max_len * 2.0f);
+               immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
+               immUniformColor3ubv(color);
 
-       for (;(ak) && (ak->cfra <= v2d->cur.xmax);
-            ak = ak->next)
-       {
-               immVertex2f(pos, ak->cfra, ymin);
-               immVertex2f(pos, ak->cfra, ymax);
-       }
+               immBeginAtMost(GL_LINES, max_len * 2.0f);
 
-       immEnd();
-       immUnbindProgram();
+               for (; (ak) && (ak->cfra <= v2d->cur.xmax);
+                       ak = ak->next)
+               {
+                       immVertex2f(pos, ak->cfra, ymin);
+                       immVertex2f(pos, ak->cfra, ymax);
+               }
+
+               immEnd();
+               immUnbindProgram();
+       }
 
        /* free temp stuff */
        BLI_dlrbTree_free(&keys);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to