Always round down point coords inside the window.
Or 3839 rounds to 1920 and the point falls outside of Qt window.
This commit is contained in:
parent
6e81116513
commit
e053e04607
1 changed files with 4 additions and 2 deletions
|
|
@ -548,8 +548,10 @@ bool WindowHelper::handleNativeEvent(
|
|||
|
||||
POINT p{ GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
|
||||
ScreenToClient(_handle, &p);
|
||||
const auto mapped = QPoint(p.x, p.y)
|
||||
/ window()->windowHandle()->devicePixelRatio();
|
||||
const auto ratio = window()->windowHandle()->devicePixelRatio();
|
||||
const auto mapped = QPoint(
|
||||
int(std::floor(p.x / ratio)),
|
||||
int(std::floor(p.y / ratio)));
|
||||
*result = [&] {
|
||||
if (!window()->rect().contains(mapped)) {
|
||||
return HTTRANSPARENT;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue