From 1e5ec4fe43d7cc6ef77bd3cb0504c0ade3ae1c6e Mon Sep 17 00:00:00 2001 From: subhransu mohanty Date: Tue, 25 Jun 2019 19:04:11 +0900 Subject: [PATCH] rlottie: use correct default opacity value. Change-Id: I9b2012a0951aecb1ead036181fb1f90c50a9bcdd --- src/lottie/lottiemodel.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lottie/lottiemodel.h b/src/lottie/lottiemodel.h index 6fe9335..2284d25 100644 --- a/src/lottie/lottiemodel.h +++ b/src/lottie/lottiemodel.h @@ -613,7 +613,7 @@ class LOTFillData : public LOTData public: LOTFillData():LOTData(LOTData::Type::Fill){} LottieColor color(int frameNo) const {return mColor.value(frameNo);} - float opacity(int frameNo) const {return mOpacity.value(frameNo)/100.0;} + float opacity(int frameNo) const {return mOpacity.value(frameNo)/100.0f;} FillRule fillRule() const {return mFillRule;} public: FillRule mFillRule{FillRule::Winding}; /* "r" */ @@ -634,7 +634,7 @@ class LOTStrokeData : public LOTData public: LOTStrokeData():LOTData(LOTData::Type::Stroke){} LottieColor color(int frameNo) const {return mColor.value(frameNo);} - float opacity(int frameNo) const {return mOpacity.value(frameNo)/100.0;} + float opacity(int frameNo) const {return mOpacity.value(frameNo)/100.0f;} float strokeWidth(int frameNo) const {return mWidth.value(frameNo);} CapStyle capStyle() const {return mCapStyle;} JoinStyle joinStyle() const {return mJoinStyle;} @@ -712,7 +712,7 @@ class LOTGradient : public LOTData { public: explicit LOTGradient(LOTData::Type type):LOTData(type){} - inline float opacity(int frameNo) const {return mOpacity.value(frameNo)/100.0;} + inline float opacity(int frameNo) const {return mOpacity.value(frameNo)/100.0f;} void update(std::unique_ptr &grad, int frameNo); private: @@ -723,7 +723,7 @@ public: LOTAnimatable mEndPoint; /* "e" */ LOTAnimatable mHighlightLength{0}; /* "h" */ LOTAnimatable mHighlightAngle{0}; /* "a" */ - LOTAnimatable mOpacity{0}; /* "o" */ + LOTAnimatable mOpacity{100}; /* "o" */ LOTAnimatable mGradient; /* "g" */ int mColorPoints{-1}; bool mEnabled{true}; /* "fillEnabled" */ @@ -789,7 +789,7 @@ public: bool isStatic() const {return mIsStatic;} public: LOTAnimatable mShape; - LOTAnimatable mOpacity; + LOTAnimatable mOpacity{100}; bool mInv{false}; bool mIsStatic{true}; LOTMaskData::Mode mMode; -- 2.34.1