fix: game high dpi support

dev
rankun 6 years ago
parent 3798975793
commit 09d3837052

@ -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();

Loading…
Cancel
Save