mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Extract some Lottie::Animation code to Lottie::Player.
This commit is contained in:
@@ -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(
|
||||
|
@@ -12,7 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "data/data_file_origin.h"
|
||||
|
||||
namespace Lottie {
|
||||
class Animation;
|
||||
class SinglePlayer;
|
||||
} // namespace Lottie
|
||||
|
||||
namespace Window {
|
||||
@@ -236,7 +236,7 @@ private:
|
||||
DocumentData *_document = nullptr;
|
||||
PhotoData *_photo = nullptr;
|
||||
Media::Clip::ReaderPointer _gif;
|
||||
std::unique_ptr<Lottie::Animation> _lottie;
|
||||
std::unique_ptr<Lottie::SinglePlayer> _lottie;
|
||||
|
||||
int _emojiSize;
|
||||
std::vector<not_null<EmojiPtr>> _emojiList;
|
||||
|
Reference in New Issue
Block a user