Paint last empty frame in sticker effects.

This commit is contained in:
John Preston 2022-04-26 16:49:39 +04:00
parent 6f285874f3
commit ee793a2c59
2 changed files with 10 additions and 3 deletions

View file

@ -266,12 +266,18 @@ void EmojiInteractions::paint(QPainter &p) {
play.framesCount = information.framesCount;
play.frameRate = information.frameRate;
}
if (play.frame + 1 == play.framesCount) {
const auto rect = computeRect(
play.view,
play.premium).translated(play.shift);
if (play.started && !play.frame) {
play.finished = true;
_updateRequests.fire_copy(rect);
continue;
} else if (play.frame > 0) {
play.started = true;
}
const auto rect = computeRect(play.view, play.premium);
p.drawImage(
QRect(rect.topLeft() + play.shift, frame.image.size() / factor),
QRect(rect.topLeft(), frame.image.size() / factor),
frame.image);
play.lottie->markFrameShown();
}

View file

@ -52,6 +52,7 @@ private:
int framesCount = 0;
int frameRate = 0;
bool premium = false;
bool started = false;
bool finished = false;
};
struct Delayed {