Fix userpic rounding

This commit is contained in:
Eric Kotato 2020-12-27 19:54:19 +03:00
parent 19c1764bd1
commit 8f133b5791

View file

@ -793,7 +793,23 @@ void UserpicButton::setImage(QImage &&image) {
size * cIntRetinaFactor(), size * cIntRetinaFactor(),
Qt::IgnoreAspectRatio, Qt::IgnoreAspectRatio,
Qt::SmoothTransformation); 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 = App::pixmapFromImageInPlace(std::move(small));
_userpic.setDevicePixelRatio(cRetinaFactor()); _userpic.setDevicePixelRatio(cRetinaFactor());
_userpicCustom = _userpicHasImage = true; _userpicCustom = _userpicHasImage = true;