mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
lottie: corrected a shallow keyframe data copy bug
The previous assignment operator was missed due to a template error, which has now been corrected. issue: https://github.com/thorvg/thorvg/issues/2797
This commit is contained in:
parent
ed90581a1f
commit
c830abb901
3 changed files with 4 additions and 3 deletions
|
@ -299,6 +299,7 @@ bool LottieLoader::override(const char* slot)
|
|||
|
||||
//parsing slot json
|
||||
LottieParser parser(temp, dirName);
|
||||
parser.comp = comp;
|
||||
|
||||
auto idx = 0;
|
||||
while (auto sid = parser.sid(idx == 0)) {
|
||||
|
|
|
@ -1444,7 +1444,7 @@ bool LottieParser::apply(LottieSlot* slot)
|
|||
case LottieProperty::Type::Color: {
|
||||
obj = new LottieSolid;
|
||||
context.parent = obj;
|
||||
parseSlotProperty<LottieProperty::Type::Color>(static_cast<LottieSolid*>(obj)->color);
|
||||
parseSlotProperty<LottieProperty::Type::Color>(static_cast<LottieSolid*>(obj)->color);
|
||||
break;
|
||||
}
|
||||
case LottieProperty::Type::TextDoc: {
|
||||
|
|
|
@ -329,12 +329,12 @@ struct LottieGenericProperty : LottieProperty
|
|||
return operator()(frameNo);
|
||||
}
|
||||
|
||||
T& operator=(const T& other)
|
||||
LottieGenericProperty<T>& operator=(const LottieGenericProperty<T>& other)
|
||||
{
|
||||
//shallow copy, used for slot overriding
|
||||
if (other.frames) {
|
||||
frames = other.frames;
|
||||
const_cast<T&>(other).frames = nullptr;
|
||||
const_cast<LottieGenericProperty<T>&>(other).frames = nullptr;
|
||||
} else value = other.value;
|
||||
return *this;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue