summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/uikit/quikitscreen.mm6
-rw-r--r--src/plugins/platforms/uikit/quikitwindow.mm9
2 files changed, 13 insertions, 2 deletions
diff --git a/src/plugins/platforms/uikit/quikitscreen.mm b/src/plugins/platforms/uikit/quikitscreen.mm
index 42a0cd6..b7e2324 100644
--- a/src/plugins/platforms/uikit/quikitscreen.mm
+++ b/src/plugins/platforms/uikit/quikitscreen.mm
@@ -54,7 +54,11 @@ QUIKitScreen::QUIKitScreen(int screenIndex)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
CGRect bounds = [uiScreen() bounds];
- m_geometry = QRect(bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height);
+ CGFloat scale = [uiScreen() scale];
+ m_geometry = QRect(bounds.origin.x * scale,
+ bounds.origin.y * scale,
+ bounds.size.width * scale,
+ bounds.size.height * scale);
m_format = QImage::Format_ARGB32_Premultiplied;
diff --git a/src/plugins/platforms/uikit/quikitwindow.mm b/src/plugins/platforms/uikit/quikitwindow.mm
index 288944c..99ba149 100644
--- a/src/plugins/platforms/uikit/quikitwindow.mm
+++ b/src/plugins/platforms/uikit/quikitwindow.mm
@@ -262,7 +262,8 @@ private:
{
UITouch *touch = [touches anyObject];
CGPoint locationInView = [touch locationInView:self];
- QPoint p(locationInView.x, locationInView.y);
+ CGFloat scaleFactor = [self contentScaleFactor];
+ QPoint p(locationInView.x * scaleFactor, locationInView.y * scaleFactor);
// TODO handle global touch point? for status bar?
QWindowSystemInterface::handleMouseEvent(mWindow->widget(), (ulong)(event.timestamp*1000),
p, p, buttons);
@@ -370,6 +371,7 @@ UIWindow *QUIKitWindow::ensureNativeWindow()
// view
[mView deleteFramebuffer];
mView.frame = CGRectMake(0, 0, mWindow.bounds.size.width, mWindow.bounds.size.height); // fill
+ [mView setContentScaleFactor:[mWindow.screen scale]];
[mView setMultipleTouchEnabled:YES];
[mView setWindow:this];
[mWindow addSubview:mView];
@@ -413,6 +415,11 @@ void QUIKitWindow::updateGeometryAndOrientation()
angle = +M_PI/2.;
break;
}
+
+ CGFloat scale = [mScreen->uiScreen() scale];
+ geom = QRect(geom.x() * scale, geom.y() * scale,
+ geom.width() * scale, geom.height() * scale);
+
if (angle != 0) {
[mView layer].transform = CATransform3DMakeRotation(angle, 0, 0, 1.);
} else {