aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/skottie/Skottie.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'experimental/skottie/Skottie.cpp')
-rw-r--r--experimental/skottie/Skottie.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/experimental/skottie/Skottie.cpp b/experimental/skottie/Skottie.cpp
index a7b6b23817..5a04e5a719 100644
--- a/experimental/skottie/Skottie.cpp
+++ b/experimental/skottie/Skottie.cpp
@@ -427,19 +427,21 @@ std::vector<sk_sp<sksg::GeometryNode>> AttachTrimGeometryEffect(
std::vector<sk_sp<sksg::GeometryNode>> trimmed;
trimmed.reserve(inputs.size());
for (const auto& i : inputs) {
- const auto trim = sksg::TrimEffect::Make(i);
- trimmed.push_back(trim);
+ const auto trimEffect = sksg::TrimEffect::Make(i);
+ trimmed.push_back(trimEffect);
+
+ const auto trimComposite = sk_make_sp<CompositeTrimEffect>(std::move(trimEffect));
BindProperty<ScalarValue>(jtrim["s"], &ctx->fAnimators,
- [trim](const ScalarValue& s) {
- trim->setStart(s * 0.01f);
+ [trimComposite](const ScalarValue& s) {
+ trimComposite->setStart(s);
});
BindProperty<ScalarValue>(jtrim["e"], &ctx->fAnimators,
- [trim](const ScalarValue& e) {
- trim->setEnd(e * 0.01f);
+ [trimComposite](const ScalarValue& e) {
+ trimComposite->setEnd(e);
});
BindProperty<ScalarValue>(jtrim["o"], &ctx->fAnimators,
- [trim](const ScalarValue& o) {
- trim->setOffset(o / 360);
+ [trimComposite](const ScalarValue& o) {
+ trimComposite->setOffset(o);
});
}