From e0fd5d8795067fdbc85c2d92a6fe5cdd4e19cabe Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 6 Jan 2022 20:50:21 +0300 Subject: [PATCH] Fix reactions dropdown on Retina screen. --- .../history/view/history_view_react_button.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_react_button.cpp b/Telegram/SourceFiles/history/view/history_view_react_button.cpp index c8a81c04f..f009db74b 100644 --- a/Telegram/SourceFiles/history/view/history_view_react_button.cpp +++ b/Telegram/SourceFiles/history/view/history_view_react_button.cpp @@ -755,7 +755,7 @@ void Manager::paintButton( p.drawImage( geometry, _expandedBuffer, - QRect(QPoint(), size / style::DevicePixelRatio())); + QRect(QPoint(), size * style::DevicePixelRatio())); } if (opacity != 1.) { p.setOpacity(1.); @@ -776,9 +776,11 @@ void Manager::overlayExpandedBorder( const auto maskSize = QRect(0, 0, maxSide, minHeight).marginsAdded( st::reactionCornerShadow ).size(); + const auto ratio = style::DevicePixelRatio(); auto mask = QImage( - maskSize * style::DevicePixelRatio(), + maskSize * ratio, QImage::Format_ARGB32_Premultiplied); + mask.setDevicePixelRatio(ratio); mask.fill(Qt::transparent); { auto q = Painter(&mask); @@ -796,8 +798,9 @@ void Manager::overlayExpandedBorder( } auto shadowMask = QImage( - maskSize * style::DevicePixelRatio(), + maskSize * ratio, QImage::Format_ARGB32_Premultiplied); + shadowMask.setDevicePixelRatio(ratio); shadowMask.fill(Qt::transparent); { auto q = Painter(&shadowMask);