aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--experimental/skottie/SkottieAnimator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/experimental/skottie/SkottieAnimator.cpp b/experimental/skottie/SkottieAnimator.cpp
index c5cea588eb..838bf2a9ec 100644
--- a/experimental/skottie/SkottieAnimator.cpp
+++ b/experimental/skottie/SkottieAnimator.cpp
@@ -95,9 +95,11 @@ protected:
SkASSERT(!rec.isConstant());
SkASSERT(t > rec.t0 && t < rec.t1);
- auto lt = (t -rec.t0) / (rec.t1 - rec.t0);
+ auto lt = (t - rec.t0) / (rec.t1 - rec.t0);
- return rec.cmidx < 0 ? lt : fCubicMaps[rec.cmidx].computeYFromX(lt);
+ return rec.cmidx < 0
+ ? lt
+ : SkTPin(fCubicMaps[rec.cmidx].computeYFromX(lt), 0.0f, 1.0f);
}
virtual int parseValue(const Json::Value&) = 0;