aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/skotty/SkottyProperties.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'experimental/skotty/SkottyProperties.cpp')
-rw-r--r--experimental/skotty/SkottyProperties.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/experimental/skotty/SkottyProperties.cpp b/experimental/skotty/SkottyProperties.cpp
index f65a106735..1a3a14593c 100644
--- a/experimental/skotty/SkottyProperties.cpp
+++ b/experimental/skotty/SkottyProperties.cpp
@@ -39,6 +39,11 @@ bool ParsePoints(const Json::Value& v, PointArray* pts) {
} // namespace
bool ScalarValue::Parse(const Json::Value& v, ScalarValue* scalar) {
+ // Some files appear to wrap keyframes in arrays for no reason.
+ if (v.isArray() && v.size() == 1) {
+ return Parse(v[0], scalar);
+ }
+
if (v.isNull() || !v.isConvertibleTo(Json::realValue))
return false;
@@ -68,8 +73,8 @@ bool ShapeValue::Parse(const Json::Value& v, ShapeValue* shape) {
outPts,
verts;
- // Some files appear to wrap these in arrays for no reason.
- if (v.isArray()) {
+ // Some files appear to wrap keyframes in arrays for no reason.
+ if (v.isArray() && v.size() == 1) {
return Parse(v[0], shape);
}
@@ -135,6 +140,7 @@ SkPath ShapeValue::as<SkPath>() const {
if (fClose) {
addCubic(fVertices.back(), fVertices.front(), &path);
+ path.close();
}
return path;