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:
parent
aa3ead5e28
commit
bf48687544
1 changed files with 6 additions and 2 deletions
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue