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.
This commit is contained in:
Antonio Vazquez
2019-11-30 17:05:08 +01:00
parent 5c0f1e1a4e
commit f0e7fd4ad6

View File

@@ -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;