From 2c015358f7f39df703cfade9d2f15500bb1a29ad Mon Sep 17 00:00:00 2001 From: Barry <870709864@qq.com> Date: Sat, 9 Apr 2022 12:10:06 +0800 Subject: [PATCH] fix: grab rect dpi error --- QtScrcpy/device/ui/videoform.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QtScrcpy/device/ui/videoform.cpp b/QtScrcpy/device/ui/videoform.cpp index 295e652..d6b6827 100644 --- a/QtScrcpy/device/ui/videoform.cpp +++ b/QtScrcpy/device/ui/videoform.cpp @@ -90,8 +90,8 @@ QRect VideoForm::getGrabCursorRect() #if defined(Q_OS_WIN32) rc = QRect(ui->keepRatioWidget->mapToGlobal(m_videoWidget->pos()), m_videoWidget->size()); // high dpi support - rc.setTopLeft(rc.topLeft() * m_videoWidget->devicePixelRatio()); - rc.setBottomRight(rc.bottomRight() * m_videoWidget->devicePixelRatio()); + rc.setTopLeft(rc.topLeft() * m_videoWidget->devicePixelRatioF()); + rc.setBottomRight(rc.bottomRight() * m_videoWidget->devicePixelRatioF()); rc.setX(rc.x() + 10); rc.setY(rc.y() + 10);