mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +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) {
|
||||
_peer->paintUserpic(p, view, 0, 0, size);
|
||||
} 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);
|
||||
} else {
|
||||
const auto r = size / 2.;
|
||||
const auto empty = _peer->generateUserpicImage(view, size, r);
|
||||
const auto full = size * style::DevicePixelRatio();
|
||||
const auto r = full / 2.;
|
||||
const auto empty = _peer->generateUserpicImage(view, full, r);
|
||||
p.drawImage(QRect(0, 0, size, size), empty);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue