mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-01 00:35:33 +00:00
lottie: remove the combined alpha value and method from path item
Alpha(opacity) values are not applied to path items. Fill, Stroke and etc will handle opacity. Change-Id: I8e05989e7f85797a00508c7ca151b1805d44f454
This commit is contained in:
committed by
Subhransu Mohanty
parent
25784d646a
commit
318151a35d
@@ -648,12 +648,11 @@ void LOTPathDataItem::addTrimOperation(std::vector<LOTTrimItem *> &list)
|
||||
}
|
||||
|
||||
void LOTPathDataItem::update(int frameNo, const VMatrix &parentMatrix,
|
||||
float parentAlpha, const DirtyFlag &flag)
|
||||
float, const DirtyFlag &flag)
|
||||
{
|
||||
VPath tempPath;
|
||||
|
||||
mPathChanged = false;
|
||||
mCombinedAlpha = parentAlpha;
|
||||
|
||||
// 1. update the local path if needed
|
||||
if (!(mInit && mStaticPath) && hasChanged(frameNo)) {
|
||||
@@ -825,10 +824,8 @@ void LOTFillItem::updateRenderNode(LOTPathDataItem *pathNode,
|
||||
VDrawable *drawable, bool sameParent)
|
||||
{
|
||||
VColor color = mColor;
|
||||
if (sameParent)
|
||||
color.setAlpha(color.a * pathNode->combinedAlpha());
|
||||
else
|
||||
color.setAlpha(color.a * parentAlpha() * pathNode->combinedAlpha());
|
||||
|
||||
color.setAlpha(color.a * parentAlpha());
|
||||
VBrush brush(color);
|
||||
drawable->setBrush(brush);
|
||||
drawable->setFillRule(mFillRule);
|
||||
@@ -889,11 +886,8 @@ void LOTStrokeItem::updateRenderNode(LOTPathDataItem *pathNode,
|
||||
VDrawable *drawable, bool sameParent)
|
||||
{
|
||||
VColor color = mColor;
|
||||
if (sameParent)
|
||||
color.setAlpha(color.a * pathNode->combinedAlpha());
|
||||
else
|
||||
color.setAlpha(color.a * parentAlpha() * pathNode->combinedAlpha());
|
||||
|
||||
color.setAlpha(color.a * parentAlpha());
|
||||
VBrush brush(color);
|
||||
drawable->setBrush(brush);
|
||||
float scale = getScale(mParentMatrix);
|
||||
|
||||
@@ -208,7 +208,6 @@ public:
|
||||
void update(int frameNo, const VMatrix &parentMatrix, float parentAlpha, const DirtyFlag &flag) final;
|
||||
VPath path() const;
|
||||
void addTrimOperation(std::vector<LOTTrimItem *> &list);
|
||||
inline float combinedAlpha() const{ return mCombinedAlpha;}
|
||||
void renderList(std::vector<VDrawable *> &list) final;
|
||||
private:
|
||||
std::vector<LOTTrimItem *> mTrimNodeRefs;
|
||||
@@ -219,7 +218,6 @@ private:
|
||||
VPath mLocalPath;
|
||||
VPath mFinalPath;
|
||||
bool mPathChanged;
|
||||
float mCombinedAlpha;
|
||||
protected:
|
||||
virtual void updatePath(VPath& path, int frameNo) = 0;
|
||||
virtual bool hasChanged(int frameNo) = 0;
|
||||
|
||||
Reference in New Issue
Block a user