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:
authorAntonio Vazquez <blendergit@gmail.com>2019-11-30 19:05:08 +0300
committerAntonio Vazquez <blendergit@gmail.com>2019-11-30 19:05:08 +0300
commitf0e7fd4ad62ec1dd5c9632050a8fde347c28656f (patch)
tree8848cea8bc69195b82cb0fa4f0d6527532e25f21 /source/blender/gpencil_modifiers/intern
parent5c0f1e1a4e88cbbfaf90691e7c642fa053dd5cc7 (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/gpencil_modifiers/intern')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c10
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;