From 4116435e2be139d40b27df827cdc9825cedd90f1 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 11 Jul 2018 15:45:17 +0200 Subject: Fix T55914: Blender 2.8 Crashes when increasing the repeat count for a track in NLA Logical mistake in repeated strips drawing code. --- source/blender/editors/space_nla/nla_draw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_nla/nla_draw.c') diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 3f1bd0db74c..5b68c7b6bb7 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -512,13 +512,13 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri } /* if action-clip strip, draw lines delimiting repeats too (in the same color as outline) */ - if ((strip->type == NLASTRIP_TYPE_CLIP) && IS_EQF(strip->repeat, 1.0f) == 0) { + if ((strip->type == NLASTRIP_TYPE_CLIP) && strip->repeat > 1.0f) { float repeatLen = (strip->actend - strip->actstart) * strip->scale; /* only draw lines for whole-numbered repeats, starting from the first full-repeat * up to the last full repeat (but not if it lies on the end of the strip) */ - immBeginAtMost(GWN_PRIM_LINES, 2 * (strip->repeat - 1)); + immBeginAtMost(GWN_PRIM_LINES, 2 * floorf(strip->repeat)); for (int i = 1; i < strip->repeat; i++) { float repeatPos = strip->start + (repeatLen * i); -- cgit v1.2.3