mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-10 14:41:50 +00:00
loader/lottie: implemented missing hold interpolation.
path/colorstop has been missed to implement that feature.
This commit is contained in:
parent
ed1b4a4923
commit
e4330f7089
1 changed files with 11 additions and 0 deletions
|
@ -302,6 +302,12 @@ struct LottiePathSet
|
||||||
auto t = float(frameNo - pframe->no) / float(frame->no - pframe->no);
|
auto t = float(frameNo - pframe->no) / float(frame->no - pframe->no);
|
||||||
if (pframe->interpolator) t = pframe->interpolator->progress(t);
|
if (pframe->interpolator) t = pframe->interpolator->progress(t);
|
||||||
|
|
||||||
|
if (pframe->hold) {
|
||||||
|
if (t < 1.0f) copy(pframe->value, pts);
|
||||||
|
else copy(frame->value, pts);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
auto s = pframe->value.pts;
|
auto s = pframe->value.pts;
|
||||||
auto e = frame->value.pts;
|
auto e = frame->value.pts;
|
||||||
|
|
||||||
|
@ -390,6 +396,11 @@ struct LottieColorStop
|
||||||
auto t = float(frameNo - pframe->no) / float(frame->no - pframe->no);
|
auto t = float(frameNo - pframe->no) / float(frame->no - pframe->no);
|
||||||
if (pframe->interpolator) t = pframe->interpolator->progress(t);
|
if (pframe->interpolator) t = pframe->interpolator->progress(t);
|
||||||
|
|
||||||
|
if (pframe->hold) {
|
||||||
|
if (t < 1.0f) fill->colorStops(pframe->value.data, count);
|
||||||
|
else fill->colorStops(frame->value.data, count);
|
||||||
|
}
|
||||||
|
|
||||||
auto s = pframe->value.data;
|
auto s = pframe->value.data;
|
||||||
auto e = frame->value.data;
|
auto e = frame->value.data;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue