diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2013-11-22 17:41:39 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-25 17:11:26 +0100 |
commit | 99474206f4538799f896c9bfc8fce8d676aded26 (patch) | |
tree | b00525f26507942ee35453e593d8fc768d4d9f17 /src/plugins/platforms/ios/qioswindow.mm | |
parent | 0bfc1c8647c0137de08c5f9b44b1c7be44a44c7d (diff) |
iOS: don't loose precision when converting CG types
CGRect and CGPoint consist of CGFloat variables. So
we should convert to QRectF and QPointF rather than
QRect and QPoint.
Change-Id: I76f180e4064f54d5810c49b88fdbbcd914bdb686
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/plugins/platforms/ios/qioswindow.mm')
-rw-r--r-- | src/plugins/platforms/ios/qioswindow.mm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 7030df5d32..d03889abb6 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -188,9 +188,9 @@ actualGeometry = fromCGRect(CGRectOffset([self.superview convertRect:self.frame toView:rootView], -rootViewPositionInRelationToRootViewController.origin.x, -rootViewPositionInRelationToRootViewController.origin.y - + rootView.bounds.origin.y)); + + rootView.bounds.origin.y)).toRect(); } else { - actualGeometry = fromCGRect(self.frame); + actualGeometry = fromCGRect(self.frame).toRect(); } // Persist the actual/new geometry so that QWindow::geometry() can @@ -214,7 +214,7 @@ - (void)displayLayer:(CALayer *)layer { - QRect geometry = fromCGRect(layer.frame); + QRect geometry = fromCGRect(layer.frame).toRect(); Q_ASSERT(m_qioswindow->geometry() == geometry); Q_ASSERT(self.hidden == !m_qioswindow->window()->isVisible()); @@ -242,7 +242,7 @@ } else { touchPoint.state = state; touchPoint.pressure = (state == Qt::TouchPointReleased) ? 0.0 : 1.0; - QPoint touchPos = fromCGPoint([uiTouch locationInView:rootView]); + QPoint touchPos = fromCGPoint([uiTouch locationInView:rootView]).toPoint(); touchPoint.area = QRectF(touchPos, QSize(0, 0)); touchPoint.normalPosition = QPointF(touchPos.x() / rootViewSize.width, touchPos.y() / rootViewSize.height); } |