From 3874c9127a9f9b7bbe6d30c0489bae05a1558f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Wed, 10 Feb 2021 14:54:53 +0100 Subject: [PATCH] take devicePixelRatio into account when copying a part of a QPixmap (frequently of 2 in macbook and retina displays) --- src/desktop/UBCustomCaptureWindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/desktop/UBCustomCaptureWindow.cpp b/src/desktop/UBCustomCaptureWindow.cpp index 2f5414e0..dc26abad 100644 --- a/src/desktop/UBCustomCaptureWindow.cpp +++ b/src/desktop/UBCustomCaptureWindow.cpp @@ -60,7 +60,11 @@ QPixmap UBCustomCaptureWindow::getSelectedPixmap() { if (mSelectionBand) { - return mWholeScreenPixmap.copy(mSelectionBand->geometry()); + QRect r = mSelectionBand->geometry(); + return mWholeScreenPixmap.copy( r.x() *mWholeScreenPixmap.devicePixelRatio(), + r.y() *mWholeScreenPixmap.devicePixelRatio(), + r.width() *mWholeScreenPixmap.devicePixelRatio(), + r.height() *mWholeScreenPixmap.devicePixelRatio()); } else {