2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Refactor image transformation interfaces.

This commit is contained in:
John Preston
2022-01-21 15:31:39 +03:00
parent a9a6d8a568
commit 3ff17a8789
55 changed files with 546 additions and 789 deletions

View File

@@ -446,8 +446,9 @@ void BackgroundRow::paintEvent(QPaintEvent *e) {
if (!backThumb) {
p.drawPixmap(0, 0, _background);
} else {
const auto &pix = backThumb->pixBlurred(
st::settingsBackgroundThumb);
const auto &pix = backThumb->pix(
st::settingsBackgroundThumb,
{ .options = Images::Option::Blur });
const auto factor = cIntRetinaFactor();
p.drawPixmap(
0,
@@ -612,8 +613,8 @@ void BackgroundRow::updateImage() {
auto back = (paper.isPattern() || !background.gradientForFill().isNull())
? preparePattern()
: prepareNormal();
Images::prepareRound(back, ImageRoundRadius::Small);
_background = Ui::PixmapFromImage(std::move(back));
_background = Ui::PixmapFromImage(
Images::Round(std::move(back), ImageRoundRadius::Small));
_background.setDevicePixelRatio(cRetinaFactor());
rtlupdate(radialRect());