diff options
author | Eike Ziller <eike.ziller@nokia.com> | 2012-08-15 10:50:57 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-23 08:25:55 (GMT) |
commit | e645bc3ccfb3c4a8186cbe7864657e97f9536348 (patch) | |
tree | 84502903d2eb2ef4ce7790ff6cefa33bea5309e9 | |
parent | c84ac8de9c6502caaa8cbdc8fbc2de3029a40afc (diff) | |
download | Qt-e645bc3ccfb3c4a8186cbe7864657e97f9536348.zip Qt-e645bc3ccfb3c4a8186cbe7864657e97f9536348.tar.gz Qt-e645bc3ccfb3c4a8186cbe7864657e97f9536348.tar.bz2 |
uikit: update screen geometry correctly for interface orientation
Broke with baeb42184402454da3e337bbfa2f4d5c7346435f
Change-Id: Ia8d844b7b4b9815a1cce4a1acccdbe515149d3ea
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
-rw-r--r-- | src/plugins/platforms/uikit/quikitscreen.mm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/plugins/platforms/uikit/quikitscreen.mm b/src/plugins/platforms/uikit/quikitscreen.mm index a35a3cd..86e88c6 100644 --- a/src/plugins/platforms/uikit/quikitscreen.mm +++ b/src/plugins/platforms/uikit/quikitscreen.mm @@ -55,10 +55,7 @@ QUIKitScreen::QUIKitScreen(int screenIndex) NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; CGRect bounds = [uiScreen() bounds]; CGFloat scale = [uiScreen() scale]; - m_geometry = QRect(bounds.origin.x * scale, - bounds.origin.y * scale, - bounds.size.width * scale, - bounds.size.height * scale); + updateInterfaceOrientation(); m_format = QImage::Format_ARGB32_Premultiplied; @@ -93,15 +90,17 @@ UIScreen *QUIKitScreen::uiScreen() const void QUIKitScreen::updateInterfaceOrientation() { CGRect bounds = [uiScreen() bounds]; + CGFloat scale = [uiScreen() scale]; switch ([[UIApplication sharedApplication] statusBarOrientation]) { case UIInterfaceOrientationPortrait: case UIInterfaceOrientationPortraitUpsideDown: - m_geometry = QRect(bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height);; + m_geometry = QRect(bounds.origin.x * scale, bounds.origin.y * scale, + bounds.size.width * scale, bounds.size.height * scale);; break; case UIInterfaceOrientationLandscapeLeft: case UIInterfaceOrientationLandscapeRight: - m_geometry = QRect(bounds.origin.x, bounds.origin.y, - bounds.size.height, bounds.size.width); + m_geometry = QRect(bounds.origin.x * scale, bounds.origin.y * scale, + bounds.size.height * scale, bounds.size.width * scale); break; } foreach (QWidget *widget, qApp->topLevelWidgets()) { |