mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-05 05:51:42 +00:00
lottie/parser: support start and end opacity property in transform object.
the start and end opacity property only exists for repater's transform object. Change-Id: I9bd7f59957ca4d90894bab5981c10c992508556c
This commit is contained in:
parent
d7ce9bab3c
commit
b15ad1e093
@ -55,11 +55,6 @@ VMatrix LOTTransformData::matrix(int frameNo, bool autoOrient) const
|
|||||||
return computeMatrix(frameNo, autoOrient);
|
return computeMatrix(frameNo, autoOrient);
|
||||||
}
|
}
|
||||||
|
|
||||||
float LOTTransformData::opacity(int frameNo) const
|
|
||||||
{
|
|
||||||
return mOpacity.value(frameNo) / 100.f;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LOTTransformData::cacheMatrix()
|
void LOTTransformData::cacheMatrix()
|
||||||
{
|
{
|
||||||
mCachedMatrix = computeMatrix(0);
|
mCachedMatrix = computeMatrix(0);
|
||||||
|
|||||||
@ -444,7 +444,9 @@ class LOTTransformData : public LOTData
|
|||||||
public:
|
public:
|
||||||
LOTTransformData():LOTData(LOTData::Type::Transform),mScale({100, 100}){}
|
LOTTransformData():LOTData(LOTData::Type::Transform),mScale({100, 100}){}
|
||||||
VMatrix matrix(int frameNo, bool autoOrient = false) const;
|
VMatrix matrix(int frameNo, bool autoOrient = false) const;
|
||||||
float opacity(int frameNo) const;
|
float opacity(int frameNo) const { return mOpacity.value(frameNo)/100;}
|
||||||
|
float startOpacity(int frameNo) const { return mStartOpacity.value(frameNo)/100;}
|
||||||
|
float endOpacity(int frameNo) const { return mEndOpacity.value(frameNo)/100;}
|
||||||
void cacheMatrix();
|
void cacheMatrix();
|
||||||
bool staticMatrix() const {return mStaticMatrix;}
|
bool staticMatrix() const {return mStaticMatrix;}
|
||||||
bool ddd() const {return m3D ? true : false;}
|
bool ddd() const {return m3D ? true : false;}
|
||||||
@ -461,6 +463,8 @@ public:
|
|||||||
LOTAnimatable<float> mOpacity{100}; /* "o" */
|
LOTAnimatable<float> mOpacity{100}; /* "o" */
|
||||||
LOTAnimatable<float> mSkew{0}; /* "sk" */
|
LOTAnimatable<float> mSkew{0}; /* "sk" */
|
||||||
LOTAnimatable<float> mSkewAxis{0}; /* "sa" */
|
LOTAnimatable<float> mSkewAxis{0}; /* "sa" */
|
||||||
|
LOTAnimatable<float> mStartOpacity{100}; /* "so" */
|
||||||
|
LOTAnimatable<float> mEndOpacity{100}; /* "eo" */
|
||||||
bool mStaticMatrix{true};
|
bool mStaticMatrix{true};
|
||||||
bool mSeparate{false};
|
bool mSeparate{false};
|
||||||
VMatrix mCachedMatrix;
|
VMatrix mCachedMatrix;
|
||||||
|
|||||||
@ -1222,7 +1222,11 @@ std::shared_ptr<LOTTransformData> LottieParserImpl::parseTransformObject(bool dd
|
|||||||
parseProperty(obj->mSkewAxis);
|
parseProperty(obj->mSkewAxis);
|
||||||
} else if (0 == strcmp(key, "o")) {
|
} else if (0 == strcmp(key, "o")) {
|
||||||
parseProperty(obj->mOpacity);
|
parseProperty(obj->mOpacity);
|
||||||
} else if (0 == strcmp(key, "hd")) {
|
} else if (0 == strcmp(key, "so")) {
|
||||||
|
parseProperty(obj->mStartOpacity);
|
||||||
|
} else if (0 == strcmp(key, "eo")) {
|
||||||
|
parseProperty(obj->mEndOpacity);
|
||||||
|
} else if (0 == strcmp(key, "hd")) {
|
||||||
obj->mHidden = GetBool();
|
obj->mHidden = GetBool();
|
||||||
} else if (0 == strcmp(key, "rx")) {
|
} else if (0 == strcmp(key, "rx")) {
|
||||||
parseProperty(obj->m3D->mRx);
|
parseProperty(obj->m3D->mRx);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user