mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
lottie: minor code change of template mismatch
subsequent change by a9cd630dfd
This commit is contained in:
parent
ed658cb8bd
commit
34d731fa94
1 changed files with 6 additions and 4 deletions
|
@ -319,6 +319,8 @@ float _loop(T* frames, float frameNo, LottieExpression* exp)
|
||||||
template<typename Frame, typename Value, LottieProperty::Type PType = LottieProperty::Type::Invalid, bool Scalar = 1>
|
template<typename Frame, typename Value, LottieProperty::Type PType = LottieProperty::Type::Invalid, bool Scalar = 1>
|
||||||
struct LottieGenericProperty : LottieProperty
|
struct LottieGenericProperty : LottieProperty
|
||||||
{
|
{
|
||||||
|
using MyProperty = LottieGenericProperty<Frame, Value, PType, Scalar>;
|
||||||
|
|
||||||
//Property has an either keyframes or single value.
|
//Property has an either keyframes or single value.
|
||||||
Array<Frame>* frames = nullptr;
|
Array<Frame>* frames = nullptr;
|
||||||
Value value;
|
Value value;
|
||||||
|
@ -327,9 +329,9 @@ struct LottieGenericProperty : LottieProperty
|
||||||
|
|
||||||
LottieGenericProperty() : LottieProperty(PType) {}
|
LottieGenericProperty() : LottieProperty(PType) {}
|
||||||
|
|
||||||
LottieGenericProperty(const LottieGenericProperty<Frame, Value>& rhs)
|
LottieGenericProperty(const MyProperty& rhs)
|
||||||
{
|
{
|
||||||
copy(const_cast<LottieGenericProperty<Frame, Value>&>(rhs));
|
copy(const_cast<MyProperty&>(rhs));
|
||||||
}
|
}
|
||||||
|
|
||||||
~LottieGenericProperty()
|
~LottieGenericProperty()
|
||||||
|
@ -385,7 +387,7 @@ struct LottieGenericProperty : LottieProperty
|
||||||
if (exps && exp) {
|
if (exps && exp) {
|
||||||
Value out{};
|
Value out{};
|
||||||
frameNo = _loop(frames, frameNo, exp);
|
frameNo = _loop(frames, frameNo, exp);
|
||||||
if (exps->result<LottieGenericProperty<Frame, Value>>(frameNo, out, exp)) return out;
|
if (exps->result<MyProperty>(frameNo, out, exp)) return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!frames) return value;
|
if (!frames) return value;
|
||||||
|
@ -403,7 +405,7 @@ struct LottieGenericProperty : LottieProperty
|
||||||
return tvg::lerp(operator()(frameNo, exps), operator()(tween.frameNo, exps), tween.progress);
|
return tvg::lerp(operator()(frameNo, exps), operator()(tween.frameNo, exps), tween.progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
void copy(LottieGenericProperty<Frame, Value, PType, Scalar>& rhs, bool shallow = true)
|
void copy(MyProperty& rhs, bool shallow = true)
|
||||||
{
|
{
|
||||||
if (LottieProperty::copy(&rhs, shallow)) return;
|
if (LottieProperty::copy(&rhs, shallow)) return;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue