1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Windows: Fixed file drag and drop for Windows 8

This commit is contained in:
ed 2019-02-19 16:01:40 +00:00
parent 38da38f658
commit 090aef2d70

View file

@ -1732,10 +1732,13 @@ public:
Point<float> screenPos;
#if JUCE_WIN_PER_MONITOR_DPI_AWARE
screenPos = convertPhysicalScreenPointToLogical (pointFromPOINT ({ mousePos.x, mousePos.y }), (HWND) peer.getNativeHandle()).toFloat();
#else
screenPos = pointFromPOINT ({ mousePos.x, mousePos.y }).toFloat() / static_cast<float> (getGlobalDPI() / USER_DEFAULT_SCREEN_DPI);
auto h = (HWND) peer.getNativeHandle();
if (isPerMonitorDPIAwareWindow (h))
screenPos = convertPhysicalScreenPointToLogical (pointFromPOINT ({ mousePos.x, mousePos.y }), h).toFloat();
else
#endif
screenPos = pointFromPOINT ({ mousePos.x, mousePos.y }).toFloat() / static_cast<float> (getGlobalDPI() / USER_DEFAULT_SCREEN_DPI);
return peer.getComponent().getLocalPoint (nullptr, screenPos);
}