diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-11-30 19:05:08 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-11-30 19:05:08 +0300 |
commit | f0e7fd4ad62ec1dd5c9632050a8fde347c28656f (patch) | |
tree | 8848cea8bc69195b82cb0fa4f0d6527532e25f21 /source/blender | |
parent | 5c0f1e1a4e88cbbfaf90691e7c642fa053dd5cc7 (diff) |
GPencil: Fix unreported error when frame is zero in Time modifier
When the frame was zero, the frame number was clamped by error to 1.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c index 01bb0ae2b93..e3ad5a64ac3 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c @@ -71,8 +71,14 @@ static int remapTime(struct GpencilModifierData *md, const bool invpass = mmd->flag & GP_TIME_INVERT_LAYERPASS; int sfra = custom ? mmd->sfra : scene->r.sfra; int efra = custom ? mmd->efra : scene->r.efra; - CLAMP_MIN(sfra, 1); - CLAMP_MIN(efra, 1); + CLAMP_MIN(sfra, 0); + CLAMP_MIN(efra, 0); + + /* Avoid inverse ranges. */ + if (efra < sfra) { + return cfra; + } + const int time_range = efra - sfra + 1; int offset = mmd->offset; int segments = 0; |