1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-16 00:34:19 +00:00

iOS: Fixed incorrect desktop window position

This commit is contained in:
ed 2020-11-30 17:23:04 +00:00
parent aed22a7e7a
commit 7053df4b5b

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);