diff --git a/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp b/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp index 915dd6d1d..96904ac1a 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp @@ -282,18 +282,26 @@ QImage EmojiImageLoader::prepare(EmojiPtr emoji) { { QPainter p(&result); const auto delta = st::largeEmojiOutline * factor; - const auto shifts = std::array{ { - { -1, -1 }, + const auto planar = std::array{ { { 0, -1 }, - { 1, -1 }, { -1, 0 }, { 1, 0 }, - { -1, 1 }, { 0, 1 }, + } }; + for (const auto &shift : planar) { + for (auto i = 0; i != delta; ++i) { + p.drawImage(QPoint(delta, delta) + shift * (i + 1), tinted); + } + } + const auto diagonal = std::array{ { + { -1, -1 }, + { 1, -1 }, + { -1, 1 }, { 1, 1 }, } }; - for (const auto &shift : shifts) { - for (auto i = 0; i != delta; ++i) { + const auto corrected = int(std::round(delta / sqrt(2.))); + for (const auto &shift : diagonal) { + for (auto i = 0; i != corrected; ++i) { p.drawImage(QPoint(delta, delta) + shift * (i + 1), tinted); } }