mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
lottie: handle time remapping with zero value correctly
The time remapping logic had an issue where animations with zero value "tm"(Time Remap) were not being processed correctly. This was happening because the previous implementation only applied time remapping when the value was non-zero. (A zero-value Time Remap should be applied, but is ignored) The fix changes the default time remap value to `-1.0` (since frame values cannot be negative) and applies time remapping when the value is 0.0 or greater. This ensures that zero value time remapping is properly processed.
This commit is contained in:
parent
6e41b44ea1
commit
1e692f223c
2 changed files with 2 additions and 2 deletions
|
@ -693,7 +693,7 @@ void LottieLayer::prepare(RGB24* color)
|
|||
|
||||
float LottieLayer::remap(LottieComposition* comp, float frameNo, LottieExpressions* exp)
|
||||
{
|
||||
if (timeRemap.frames || timeRemap.value) {
|
||||
if (timeRemap.frames || timeRemap.value >= 0.0f) {
|
||||
frameNo = comp->frameAtTime(timeRemap(frameNo, exp));
|
||||
} else {
|
||||
frameNo -= startFrame;
|
||||
|
|
|
@ -980,7 +980,7 @@ struct LottieLayer : LottieGroup
|
|||
|
||||
char* name = nullptr;
|
||||
LottieLayer* parent = nullptr;
|
||||
LottieFloat timeRemap = 0.0f;
|
||||
LottieFloat timeRemap = -1.0f;
|
||||
LottieLayer* comp = nullptr; //Precompositor, current layer is belonges.
|
||||
LottieTransform* transform = nullptr;
|
||||
Array<LottieMask*> masks;
|
||||
|
|
Loading…
Add table
Reference in a new issue