From fce4452af540fa01e886f4b4103bd7470080b85d Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 18 Jul 2022 14:00:49 +0300 Subject: [PATCH] Fix repainting of custom emoji in notifications. --- .../SourceFiles/window/notifications_manager_default.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/window/notifications_manager_default.cpp b/Telegram/SourceFiles/window/notifications_manager_default.cpp index a9bbc5863..89d7b29fc 100644 --- a/Telegram/SourceFiles/window/notifications_manager_default.cpp +++ b/Telegram/SourceFiles/window/notifications_manager_default.cpp @@ -771,7 +771,10 @@ void Notification::repaintText() { return; } Painter p(&_cache); - p.fillRect(_textRect, st::notificationBg); + const auto adjusted = Ui::Text::AdjustCustomEmojiSize(st::emojiSize); + const auto skip = (adjusted - st::emojiSize + 1) / 2; + const auto margin = QMargins{ skip, skip, skip, skip }; + p.fillRect(_textRect.marginsAdded(margin), st::notificationBg); paintText(p); update(); }