Pause animated stickers as GIFs.

This commit is contained in:
John Preston 2019-05-27 15:02:38 +02:00
parent 3577e71782
commit 3556fbf702
1 changed files with 6 additions and 1 deletions
Telegram/SourceFiles/history/media

View File

@ -16,6 +16,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/view/history_view_cursor_state.h"
#include "ui/image/image.h"
#include "ui/emoji_config.h"
#include "mainwindow.h" // App::wnd()->controller()
#include "window/window_controller.h" // isGifPausedAtLeastFor(..)
#include "data/data_session.h"
#include "data/data_document.h"
#include "lottie/lottie_animation.h"
@ -189,7 +191,10 @@ void HistorySticker::draw(Painter &p, const QRect &r, TextSelection selection, c
if (selected) {
request.colored = st::msgStickerOverlay->c;
}
_lottie->markFrameShown();
const auto paused = App::wnd()->controller()->isGifPausedAtLeastFor(Window::GifPauseReason::Any);
if (!paused) {
_lottie->markFrameShown();
}
p.drawImage(
QRect(usex + (usew - _pixw) / 2, (minHeight() - _pixh) / 2, _pixw, _pixh),
_lottie->frame(request));