mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Windows: Fixed drag and drop position for DPI-unaware windows
This commit is contained in:
parent
3411ea56f5
commit
f1a5f2ef1e
1 changed files with 4 additions and 4 deletions
|
|
@ -1780,16 +1780,16 @@ public:
|
|||
private:
|
||||
Point<float> getMousePos (POINTL mousePos) const
|
||||
{
|
||||
Point<float> screenPos;
|
||||
auto screenPos = pointFromPOINT ({ mousePos.x, mousePos.y }).toFloat();
|
||||
|
||||
#if JUCE_WIN_PER_MONITOR_DPI_AWARE
|
||||
auto h = (HWND) peer.getNativeHandle();
|
||||
|
||||
if (isPerMonitorDPIAwareWindow (h))
|
||||
screenPos = convertPhysicalScreenPointToLogical (pointFromPOINT ({ mousePos.x, mousePos.y }), h).toFloat();
|
||||
else
|
||||
screenPos = convertPhysicalScreenPointToLogical (screenPos.roundToInt(), h).toFloat();
|
||||
#else
|
||||
screenPos /= static_cast<float> (getGlobalDPI() / USER_DEFAULT_SCREEN_DPI);
|
||||
#endif
|
||||
screenPos = pointFromPOINT ({ mousePos.x, mousePos.y }).toFloat() / static_cast<float> (getGlobalDPI() / USER_DEFAULT_SCREEN_DPI);
|
||||
|
||||
return peer.getComponent().getLocalPoint (nullptr, screenPos);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue