From 4ef190cc5e6344856dffdae5a442a9ebff850336 Mon Sep 17 00:00:00 2001 From: hogliux Date: Mon, 24 Aug 2015 11:34:38 +0100 Subject: [PATCH] Fix global scale factor bug on iOS --- .../native/juce_ios_UIViewComponentPeer.mm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm index 6e55d4ccf3..687ba1ef52 100644 --- a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm @@ -659,7 +659,7 @@ void UIViewComponentPeer::setFullScreen (bool shouldBeFullScreen) // (can't call the component's setBounds method because that'll reset our fullscreen flag) if (! r.isEmpty()) - setBounds (r, shouldBeFullScreen); + setBounds (ScalingHelpers::scaledScreenPosToUnscaled (component, r), shouldBeFullScreen); component.repaint(); } @@ -700,8 +700,13 @@ void UIViewComponentPeer::updateTransformAndScreenBounds() bool UIViewComponentPeer::contains (Point localPos, bool trueIfInAChildWindow) const { - if (! component.getLocalBounds().contains (localPos)) - return false; + { + Rectangle localBounds = + ScalingHelpers::scaledScreenPosToUnscaled (component, component.getLocalBounds()); + + if (! localBounds.contains (localPos)) + return false; + } UIView* v = [view hitTest: convertToCGPoint (localPos) withEvent: nil];