From 1eb98dba2fc7afdef148145f4b577e8b14deb354 Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Fri, 26 Jan 2018 15:03:38 -0500 Subject: [skottie] Add 'rz' rotation support TBR= Change-Id: I6dd82e5dc516faac091e5173688d2bc977e4fcaa Reviewed-on: https://skia-review.googlesource.com/100280 Reviewed-by: Florin Malita Commit-Queue: Florin Malita --- experimental/skottie/Skottie.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'experimental') diff --git a/experimental/skottie/Skottie.cpp b/experimental/skottie/Skottie.cpp index 7e56106fc5..efd3d075d7 100644 --- a/experimental/skottie/Skottie.cpp +++ b/experimental/skottie/Skottie.cpp @@ -84,7 +84,14 @@ sk_sp AttachMatrix(const Json::Value& t, AttachContext* ctx, [composite](const VectorValue& s) { composite->setScale(ValueTraits::As(s)); }); - auto rotation_attached = BindProperty(t["r"], &ctx->fAnimators, + + auto* jrotation = &t["r"]; + if (jrotation->isNull()) { + // 3d rotations have separate rx,ry,rz components. While we don't fully support them, + // we can still make use of rz. + jrotation = &t["rz"]; + } + auto rotation_attached = BindProperty(*jrotation, &ctx->fAnimators, [composite](const ScalarValue& r) { composite->setRotation(r); }); -- cgit v1.2.3