diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2016-10-13 05:19:04 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2016-10-13 05:19:04 +0300 |
commit | 165bdfb6721e153e40f0c85d4e7b7b9f012a9704 (patch) | |
tree | 7dffb422b37249e27fe571d63306fd10c1863bf0 /source | |
parent | b5c539f9fa91b4966d95bf1d4efa9cef77be705b (diff) |
Fix timeline break after recent immediate mode change (rBf6e7e46f)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_time/space_time.c | 29 |
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); |