From 8f133b57912b750fb25f8ee0fd4fdc18ad2ec3a5 Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Sun, 27 Dec 2020 19:54:19 +0300 Subject: [PATCH] Fix userpic rounding --- Telegram/SourceFiles/ui/special_buttons.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/ui/special_buttons.cpp b/Telegram/SourceFiles/ui/special_buttons.cpp index c3be90d1f..9be90d51a 100644 --- a/Telegram/SourceFiles/ui/special_buttons.cpp +++ b/Telegram/SourceFiles/ui/special_buttons.cpp @@ -793,7 +793,23 @@ void UserpicButton::setImage(QImage &&image) { size * cIntRetinaFactor(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - Images::prepareCircle(small); + switch (cUserpicCornersType()) { + case 0: + Images::prepareRound(small, ImageRoundRadius::None); + break; + + case 1: + Images::prepareRound(small, ImageRoundRadius::Small); + break; + + case 2: + Images::prepareRound(small, ImageRoundRadius::Large); + break; + + default: + Images::prepareCircle(small); + } + _userpic = App::pixmapFromImageInPlace(std::move(small)); _userpic.setDevicePixelRatio(cRetinaFactor()); _userpicCustom = _userpicHasImage = true;