Fix reactions dropdown on Retina screen.

This commit is contained in:
John Preston 2022-01-06 20:50:21 +03:00
parent 8659f60b46
commit e0fd5d8795

View file

@ -755,7 +755,7 @@ void Manager::paintButton(
p.drawImage( p.drawImage(
geometry, geometry,
_expandedBuffer, _expandedBuffer,
QRect(QPoint(), size / style::DevicePixelRatio())); QRect(QPoint(), size * style::DevicePixelRatio()));
} }
if (opacity != 1.) { if (opacity != 1.) {
p.setOpacity(1.); p.setOpacity(1.);
@ -776,9 +776,11 @@ void Manager::overlayExpandedBorder(
const auto maskSize = QRect(0, 0, maxSide, minHeight).marginsAdded( const auto maskSize = QRect(0, 0, maxSide, minHeight).marginsAdded(
st::reactionCornerShadow st::reactionCornerShadow
).size(); ).size();
const auto ratio = style::DevicePixelRatio();
auto mask = QImage( auto mask = QImage(
maskSize * style::DevicePixelRatio(), maskSize * ratio,
QImage::Format_ARGB32_Premultiplied); QImage::Format_ARGB32_Premultiplied);
mask.setDevicePixelRatio(ratio);
mask.fill(Qt::transparent); mask.fill(Qt::transparent);
{ {
auto q = Painter(&mask); auto q = Painter(&mask);
@ -796,8 +798,9 @@ void Manager::overlayExpandedBorder(
} }
auto shadowMask = QImage( auto shadowMask = QImage(
maskSize * style::DevicePixelRatio(), maskSize * ratio,
QImage::Format_ARGB32_Premultiplied); QImage::Format_ARGB32_Premultiplied);
shadowMask.setDevicePixelRatio(ratio);
shadowMask.fill(Qt::transparent); shadowMask.fill(Qt::transparent);
{ {
auto q = Painter(&shadowMask); auto q = Painter(&shadowMask);