Browse Source

iOS: Fixed incorrect desktop window position

tags/2021-05-28
ed 5 years ago
parent
commit
7053df4b5b
1 changed files with 12 additions and 4 deletions
  1. +12
    -4
      modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm

+ 12
- 4
modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm View File

@@ -632,12 +632,20 @@ void UIViewComponentPeer::setBounds (const Rectangle<int>& newBounds, const bool
Rectangle<int> UIViewComponentPeer::getBounds (const bool global) const
{
CGRect r = view.frame;
auto r = view.frame;
if (global && view.window != nil)
if (global)
{
r = [view convertRect: r toView: view.window];
r = [view.window convertRect: r toWindow: nil];
if (view.window != nil)
{
r = [view convertRect: r toView: view.window];
r = [view.window convertRect: r toWindow: nil];
}
else if (window != nil)
{
r.origin.x += window.frame.origin.x;
r.origin.y += window.frame.origin.y;
}
}
return convertToRectInt (r);


Loading…
Cancel
Save