mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix device pixel ratio in stories userpics.
This commit is contained in:
parent
d5353e8741
commit
adc8966c61
1 changed files with 5 additions and 3 deletions
|
@ -141,11 +141,13 @@ QImage PeerUserpic::image(int size) {
|
||||||
if (!_forceRound) {
|
if (!_forceRound) {
|
||||||
_peer->paintUserpic(p, view, 0, 0, size);
|
_peer->paintUserpic(p, view, 0, 0, size);
|
||||||
} else if (const auto cloud = _peer->userpicCloudImage(view)) {
|
} else if (const auto cloud = _peer->userpicCloudImage(view)) {
|
||||||
Ui::ValidateUserpicCache(view, cloud, nullptr, size, false);
|
const auto full = size * style::DevicePixelRatio();
|
||||||
|
Ui::ValidateUserpicCache(view, cloud, nullptr, full, false);
|
||||||
p.drawImage(QRect(0, 0, size, size), view.cached);
|
p.drawImage(QRect(0, 0, size, size), view.cached);
|
||||||
} else {
|
} else {
|
||||||
const auto r = size / 2.;
|
const auto full = size * style::DevicePixelRatio();
|
||||||
const auto empty = _peer->generateUserpicImage(view, size, r);
|
const auto r = full / 2.;
|
||||||
|
const auto empty = _peer->generateUserpicImage(view, full, r);
|
||||||
p.drawImage(QRect(0, 0, size, size), empty);
|
p.drawImage(QRect(0, 0, size, size), empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue