2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Support animated stickers in inline results.

This commit is contained in:
John Preston
2019-07-02 15:41:50 +02:00
parent 76630528f7
commit 848ea16eef
7 changed files with 57 additions and 25 deletions

View File

@@ -879,10 +879,8 @@ void MediaPreviewWidget::paintEvent(QPaintEvent *e) {
if (!_lottie || !_lottie->ready()) {
return QImage();
}
auto request = Lottie::FrameRequest();
request.box = currentDimensions() * cIntRetinaFactor();
_lottie->markFrameShown();
return _lottie->frame(request);
return _lottie->frame();
}();
const auto pixmap = image.isNull() ? currentImage() : QPixmap();
const auto size = image.isNull() ? pixmap.size() : image.size();
@@ -1054,13 +1052,12 @@ void MediaPreviewWidget::setupLottie() {
Lottie::FrameRequest{ currentDimensions() * cIntRetinaFactor() });
_lottie->updates(
) | rpl::start_with_next_error([=](Lottie::Update update) {
) | rpl::start_with_next([=](Lottie::Update update) {
update.data.match([&](const Lottie::Information &) {
this->update();
}, [&](const Lottie::DisplayFrameRequest &) {
this->update(updateArea());
});
}, [=](Lottie::Error error) {
}, lifetime());
}