fix: game high dpi support

This commit is contained in:
rankun 2020-01-18 15:59:16 +08:00
parent 3798975793
commit 09d3837052

View file

@ -32,6 +32,9 @@ void WinMouseTap::enableMouseEventTap(QWidget *widget, bool enabled)
if(enabled) {
QRect rc(widget->parentWidget()->mapToGlobal(widget->pos())
, widget->size());
// high dpi support
rc.setTopLeft(rc.topLeft() * widget->devicePixelRatio());
rc.setBottomRight(rc.bottomRight() * widget->devicePixelRatio());
RECT mainRect;
mainRect.left = (LONG)rc.left();
mainRect.right = (LONG)rc.right();