diff --git a/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp b/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp index d1e6d61a0..147c0fdf7 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp @@ -319,14 +319,14 @@ EmojiImageLoader::EmojiImageLoader( } QImage EmojiImageLoader::prepare(EmojiPtr emoji) { - _images->ensureLoaded(); + const auto loaded = _images->ensureLoaded(); const auto factor = cIntRetinaFactor(); const auto side = st::largeEmojiSize + 2 * st::largeEmojiOutline; auto tinted = QImage( QSize(st::largeEmojiSize, st::largeEmojiSize) * factor, QImage::Format_ARGB32_Premultiplied); tinted.fill(Qt::white); - { + if (loaded) { QPainter p(&tinted); p.setCompositionMode(QPainter::CompositionMode_DestinationIn); _images->draw( @@ -340,7 +340,7 @@ QImage EmojiImageLoader::prepare(EmojiPtr emoji) { QSize(side, side) * factor, QImage::Format_ARGB32_Premultiplied); result.fill(Qt::transparent); - { + if (loaded) { QPainter p(&result); const auto delta = st::largeEmojiOutline * factor; const auto planar = std::array{ {