Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2016-10-13 05:19:04 +0300
committerDalai Felinto <dfelinto@gmail.com>2016-10-13 05:19:04 +0300
commit165bdfb6721e153e40f0c85d4e7b7b9f012a9704 (patch)
tree7dffb422b37249e27fe571d63306fd10c1863bf0 /source/blender/editors/space_time
parentb5c539f9fa91b4966d95bf1d4efa9cef77be705b (diff)
Fix timeline break after recent immediate mode change (rBf6e7e46f)
Diffstat (limited to 'source/blender/editors/space_time')
-rw-r--r--source/blender/editors/space_time/space_time.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index 0b249bfae59..8b54d26dc74 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);