2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 00:55:12 +00:00

Removed cIntRetinaFactor and cRetinaFactor.

This commit is contained in:
23rd
2024-03-24 01:04:33 +03:00
parent 58fcedab64
commit d03d50ef0d
64 changed files with 411 additions and 270 deletions

View File

@@ -365,7 +365,8 @@ int32 Photo::resizeGetHeight(int32 width) {
void Photo::paint(Painter &p, const QRect &clip, TextSelection selection, const PaintContext *context) {
const auto selected = (selection == FullSelection);
const auto widthChanged = _pix.width() != _width * cIntRetinaFactor();
const auto widthChanged = (_pix.width()
!= (_width * style::DevicePixelRatio()));
if (!_goodLoaded || widthChanged) {
ensureDataMediaCreated();
const auto good = !_spoiler
@@ -515,7 +516,7 @@ void Video::paint(Painter &p, const QRect &clip, TextSelection selection, const
const auto radialOpacity = radial ? _radial->opacity() : 0.;
if ((blurred || thumbnail || good)
&& ((_pix.width() != _width * cIntRetinaFactor())
&& ((_pix.width() != _width * style::DevicePixelRatio())
|| (_pixBlurred && (thumbnail || good)))) {
auto img = good
? good->original()
@@ -1847,7 +1848,7 @@ void Link::validateThumbnail() {
delegate()->unregisterHeavyItem(this);
} else {
const auto size = QSize(st::linksPhotoSize, st::linksPhotoSize);
_thumbnail = QPixmap(size * cIntRetinaFactor());
_thumbnail = QPixmap(size * style::DevicePixelRatio());
_thumbnail.fill(Qt::transparent);
auto p = Painter(&_thumbnail);
const auto index = _letter.isEmpty()
@@ -2061,7 +2062,7 @@ void Gif::validateThumbnail(
bool good) {
if (!image || (_thumbGood && !good)) {
return;
} else if ((_thumb.size() == size * cIntRetinaFactor())
} else if ((_thumb.size() == size * style::DevicePixelRatio())
&& (_thumbGood || !good)) {
return;
}