2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 07:25:46 +00:00

Extract some Lottie::Animation code to Lottie::Player.

This commit is contained in:
John Preston
2019-06-28 13:33:47 +02:00
parent 4a7b5a8e01
commit cbffeca8d5
23 changed files with 363 additions and 272 deletions

View File

@@ -19,7 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/image/image.h"
#include "ui/emoji_config.h"
#include "window/window_main_menu.h"
#include "lottie/lottie_animation.h"
#include "lottie/lottie_single_player.h"
#include "auth_session.h"
#include "chat_helpers/stickers.h"
#include "window/window_session_controller.h"
@@ -1049,9 +1049,8 @@ QSize MediaPreviewWidget::currentDimensions() const {
void MediaPreviewWidget::setupLottie() {
Expects(_document != nullptr);
_lottie = Lottie::FromContent(
_document->data(),
_document->filepath(),
_lottie = std::make_unique<Lottie::SinglePlayer>(
Lottie::ReadContent(_document->data(), _document->filepath()),
Lottie::FrameRequest{ currentDimensions() * cIntRetinaFactor() });
_lottie->updates(