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

Made the OSX window code handle custom desktop scale factors when constraining window positions

This commit is contained in:
jules 2016-04-26 16:57:22 +01:00
parent aa3ead5e28
commit bf48687544

View file

@ -999,8 +999,10 @@ public:
{
if (constrainer != nullptr && ! isKioskMode())
{
Rectangle<int> pos (convertToRectInt (flippedScreenRect (r)));
Rectangle<int> original (convertToRectInt (flippedScreenRect ([window frame])));
const float scale = getComponent().getDesktopScaleFactor();
Rectangle<int> pos = ScalingHelpers::unscaledScreenPosToScaled (scale, convertToRectInt (flippedScreenRect (r)));
Rectangle<int> original = ScalingHelpers::unscaledScreenPosToScaled (scale, convertToRectInt (flippedScreenRect ([window frame])));
const Rectangle<int> screenBounds (Desktop::getInstance().getDisplays().getTotalBounds (true));
@ -1023,6 +1025,8 @@ public:
pos.getX() == original.getX() && pos.getRight() != original.getRight());
}
pos = ScalingHelpers::scaledScreenPosToUnscaled (scale, pos);
r = flippedScreenRect (makeNSRect (pos));
}