QtLottie: Fix precomp layer start time.

This commit is contained in:
John Preston 2019-05-10 10:42:15 +03:00
parent 2c422dcd73
commit 3f1ec52e6c
2 changed files with 6 additions and 4 deletions

View File

@ -80,10 +80,12 @@ QImage Animation::frame(crl::time now) const {
const auto position = now;
const auto elapsed = int((_scene->frameRate() * position + 500) / 1000);
const auto frames = (_scene->endFrame() - _scene->startFrame());
const auto from = _scene->startFrame();
const auto till = _scene->endFrame();
const auto frames = (till - from);
const auto frame = _options.loop
? (_scene->startFrame() + (elapsed % frames))
: std::min(_scene->startFrame() + elapsed, _scene->endFrame());
? (from + (elapsed % frames))
: std::min(from + elapsed, till);
_scene->updateProperties(frame);

@ -1 +1 @@
Subproject commit bfc7dc4606bbba1f5c42f4868e39b48e4b5764b5
Subproject commit 9162dace0879b9190cefac0468c4dc4f92579488