mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
fix: set device pixel ratio
This commit is contained in:
parent
a3d87ff26a
commit
11b3880f8e
1 changed files with 3 additions and 10 deletions
|
@ -251,6 +251,7 @@ QImage addPadding(const QImage &original) {
|
||||||
original.height() + 2 * st::messageShotPadding,
|
original.height() + 2 * st::messageShotPadding,
|
||||||
QImage::Format_ARGB32_Premultiplied
|
QImage::Format_ARGB32_Premultiplied
|
||||||
);
|
);
|
||||||
|
paddedImage.setDevicePixelRatio(style::DevicePixelRatio());
|
||||||
paddedImage.fill(Qt::transparent);
|
paddedImage.fill(Qt::transparent);
|
||||||
|
|
||||||
Painter painter(&paddedImage);
|
Painter painter(&paddedImage);
|
||||||
|
@ -351,11 +352,11 @@ QImage Make(not_null<QWidget*> box, const ShotConfig &config) {
|
||||||
height += view->resizeGetHeight(width);
|
height += view->resizeGetHeight(width);
|
||||||
}
|
}
|
||||||
|
|
||||||
// width *= style::DevicePixelRatio();
|
|
||||||
height *= style::DevicePixelRatio();
|
height *= style::DevicePixelRatio();
|
||||||
|
|
||||||
// create the image
|
// create the image
|
||||||
QImage image(width, height, QImage::Format_ARGB32_Premultiplied);
|
QImage image(width, height, QImage::Format_ARGB32_Premultiplied);
|
||||||
|
image.setDevicePixelRatio(style::DevicePixelRatio());
|
||||||
image.fill(Qt::transparent);
|
image.fill(Qt::transparent);
|
||||||
|
|
||||||
const auto viewport = QRect(0, 0, width, height);
|
const auto viewport = QRect(0, 0, width, height);
|
||||||
|
@ -408,15 +409,6 @@ QImage Make(not_null<QWidget*> box, const ShotConfig &config) {
|
||||||
picY,
|
picY,
|
||||||
width,
|
width,
|
||||||
st::msgPhotoSize);
|
st::msgPhotoSize);
|
||||||
} else {
|
|
||||||
auto &userpic = hiddenSenderUserpics[message->id];
|
|
||||||
const auto valid = info->paintCustomUserpic(
|
|
||||||
p,
|
|
||||||
userpic,
|
|
||||||
picX,
|
|
||||||
picY,
|
|
||||||
width,
|
|
||||||
st::msgPhotoSize);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -432,6 +424,7 @@ QImage Make(not_null<QWidget*> box, const ShotConfig &config) {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto newResult = QImage(result.size(), QImage::Format_ARGB32_Premultiplied);
|
auto newResult = QImage(result.size(), QImage::Format_ARGB32_Premultiplied);
|
||||||
|
newResult.setDevicePixelRatio(style::DevicePixelRatio());
|
||||||
newResult.fill(makeDefaultBackgroundColor());
|
newResult.fill(makeDefaultBackgroundColor());
|
||||||
|
|
||||||
Painter painter(&newResult);
|
Painter painter(&newResult);
|
||||||
|
|
Loading…
Add table
Reference in a new issue