This commit is contained in:
朱子楚\zhuzi 2024-02-27 14:02:02 +08:00
parent 19a947ffab
commit 62aead3855

View File

@ -116,7 +116,8 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
short y = HIWORD(msg->lParam);
int margins = _helper->getMargins();
QPointer<QQuickWindow> win = _helper->window;
QPoint pos = win->mapFromGlobal(QPoint(x, y));
qreal dp = _helper->window->devicePixelRatio();
QPoint pos = win->mapFromGlobal(QPoint(x/dp, y/dp));
bool left = pos.x() < margins;
bool right = pos.x() > win->width() - margins;
bool top = pos.y() < margins;