lottie/parser: support parsing auto orient property of layer.

Change-Id: Ib7d757d43633d601fd76e8c3393219f7682c9112
This commit is contained in:
subhransu mohanty
2018-11-15 11:45:57 +09:00
parent 18bb0afcfe
commit aa99eda0f7
2 changed files with 6 additions and 1 deletions

View File

@@ -300,6 +300,7 @@ public:
int solidWidth() const noexcept{return mSolidLayer.mWidth;}
int solidHeight() const noexcept{return mSolidLayer.mHeight;}
LottieColor solidColor() const noexcept{return mSolidLayer.mColor;}
bool autoOrient() const noexcept{return mAutoOrient;}
int timeRemap(int frameNo) const;
public:
struct SolidLayer {
@@ -326,6 +327,7 @@ public:
bool mHasRepeater{false};
bool mHasGradient{false};
bool mRoot{false};
bool mAutoOrient{false};
std::vector<std::shared_ptr<LOTMaskData>> mMasks;
LOTCompositionData *mCompRef;
};

View File

@@ -791,6 +791,8 @@ std::shared_ptr<LOTData> LottieParserImpl::parseLayer()
layer->mHasMask = GetBool();
} else if (0 == strcmp(key, "masksProperties")) {
parseMaskProperty(layer);
} else if (0 == strcmp(key, "ao")) {
layer->mAutoOrient = GetInt();
} else {
#ifdef DEBUG_PARSER
vWarning << "Layer Attribute Skipped : " << key;
@@ -1206,7 +1208,7 @@ std::shared_ptr<LOTTransformData> LottieParserImpl::parseTransformObject()
parseProperty(obj->mSkewAxis);
} else if (0 == strcmp(key, "o")) {
parseProperty(obj->mOpacity);
} else if (0 == strcmp(key, "hd")) {
} else if (0 == strcmp(key, "hd")) {
obj->mHidden = GetBool();
} else {
Skip(key);
@@ -1916,6 +1918,7 @@ public:
<< ", outFm:" << obj->mOutFrame
<< ", stFm:" << obj->mStartFrame
<< ", ts:" << obj->mTimeStreatch
<< ", ao:" << obj->autoOrient()
<< "\n";
visitChildren(static_cast<LOTGroupData *>(obj), level);
vDebug << level