mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-01 21:38:40 +00:00
fix: game high dpi support
This commit is contained in:
parent
a978c12aaf
commit
6b811a34db
1 changed files with 3 additions and 0 deletions
|
@ -32,6 +32,9 @@ void WinMouseTap::enableMouseEventTap(QWidget *widget, bool enabled)
|
||||||
if(enabled) {
|
if(enabled) {
|
||||||
QRect rc(widget->parentWidget()->mapToGlobal(widget->pos())
|
QRect rc(widget->parentWidget()->mapToGlobal(widget->pos())
|
||||||
, widget->size());
|
, widget->size());
|
||||||
|
// high dpi support
|
||||||
|
rc.setTopLeft(rc.topLeft() * widget->devicePixelRatio());
|
||||||
|
rc.setBottomRight(rc.bottomRight() * widget->devicePixelRatio());
|
||||||
RECT mainRect;
|
RECT mainRect;
|
||||||
mainRect.left = (LONG)rc.left();
|
mainRect.left = (LONG)rc.left();
|
||||||
mainRect.right = (LONG)rc.right();
|
mainRect.right = (LONG)rc.right();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue