mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix custom emoji preview painting on Retina screen.
This commit is contained in:
parent
8383caa2b5
commit
8a9549dca3
1 changed files with 4 additions and 1 deletions
|
@ -43,7 +43,10 @@ void Preview::paint(QPainter &p, int x, int y, const QColor &preview) {
|
||||||
if (const auto path = std::get_if<ScaledPath>(&_data)) {
|
if (const auto path = std::get_if<ScaledPath>(&_data)) {
|
||||||
paintPath(p, x, y, preview, *path);
|
paintPath(p, x, y, preview, *path);
|
||||||
} else if (const auto image = std::get_if<QImage>(&_data)) {
|
} else if (const auto image = std::get_if<QImage>(&_data)) {
|
||||||
p.drawImage(x, y, *image);
|
const auto factor = style::DevicePixelRatio();
|
||||||
|
const auto width = image->width() / factor;
|
||||||
|
const auto height = image->height() / factor;
|
||||||
|
p.drawImage(QRect(x, y, width, height), *image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue