mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
lottie: handle trim path edge cases
According to the definition of trim path elements, the begin and end values are specified as percentages in the range of 0-100% (this is also confirmed by AE, where it's not possible to exceed this range). Added clamping to align with spec.
This commit is contained in:
parent
59f950e71b
commit
ac2b5c86e6
1 changed files with 2 additions and 0 deletions
|
@ -141,7 +141,9 @@ void LottieImage::prepare()
|
|||
void LottieTrimpath::segment(float frameNo, float& start, float& end, LottieExpressions* exps)
|
||||
{
|
||||
start = this->start(frameNo, exps) * 0.01f;
|
||||
tvg::clamp(start, 0.0f, 1.0f);
|
||||
end = this->end(frameNo, exps) * 0.01f;
|
||||
tvg::clamp(end, 0.0f, 1.0f);
|
||||
|
||||
auto o = fmodf(this->offset(frameNo, exps), 360.0f) / 360.0f; //0 ~ 1
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue