mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
WindowsHooks: Use appropriate dpi awareness when forwarding mouse wheel messages
This commit is contained in:
parent
46b90d9ea0
commit
5ee9d24e36
2 changed files with 12 additions and 11 deletions
|
|
@ -3196,7 +3196,7 @@ private:
|
|||
doMouseEvent (getCurrentMousePos(), MouseInputSource::defaultPressure);
|
||||
}
|
||||
|
||||
ComponentPeer* findPeerUnderMouse (Point<float>& localPos)
|
||||
std::tuple<ComponentPeer*, Point<float>> findPeerUnderMouse()
|
||||
{
|
||||
auto currentMousePos = getPOINTFromLParam ((LPARAM) GetMessagePos());
|
||||
|
||||
|
|
@ -3207,8 +3207,7 @@ private:
|
|||
if (peer == nullptr)
|
||||
peer = this;
|
||||
|
||||
localPos = peer->globalToLocal (convertPhysicalScreenPointToLogical (pointFromPOINT (currentMousePos), hwnd).toFloat());
|
||||
return peer;
|
||||
return std::tuple (peer, peer->globalToLocal (convertPhysicalScreenPointToLogical (pointFromPOINT (currentMousePos), hwnd).toFloat()));
|
||||
}
|
||||
|
||||
static MouseInputSource::InputSourceType getPointerType (WPARAM wParam)
|
||||
|
|
@ -3242,9 +3241,7 @@ private:
|
|||
wheel.isSmooth = false;
|
||||
wheel.isInertial = false;
|
||||
|
||||
Point<float> localPos;
|
||||
|
||||
if (auto* peer = findPeerUnderMouse (localPos))
|
||||
if (const auto [peer, localPos] = findPeerUnderMouse(); peer != nullptr)
|
||||
peer->handleMouseWheel (getPointerType (wParam), localPos, getMouseEventTime(), wheel);
|
||||
}
|
||||
|
||||
|
|
@ -3257,9 +3254,8 @@ private:
|
|||
if (getGestureInfo != nullptr && getGestureInfo ((HGESTUREINFO) lParam, &gi))
|
||||
{
|
||||
updateKeyModifiers();
|
||||
Point<float> localPos;
|
||||
|
||||
if (auto* peer = findPeerUnderMouse (localPos))
|
||||
if (const auto [peer, localPos] = findPeerUnderMouse(); peer != nullptr)
|
||||
{
|
||||
switch (gi.dwID)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue