diff options
author | Maurice Kalinowski <[email protected]> | 2016-05-17 12:54:41 +0200 |
---|---|---|
committer | Maurice Kalinowski <[email protected]> | 2016-06-10 09:06:06 +0000 |
commit | cae464f969e5dcf92e74c92a799fbc6ddb498a63 (patch) | |
tree | a3c87ad5be53b81e6304b5591f7d0663e9f4dabb | |
parent | 9e7e77a1eaadb507d9cd13ed6c03be9baa9bcea1 (diff) |
winrt: Take device pixel ratio into account
When resizing, the device pixel ratio needs to be taken into account.
Otherwise the area for Xaml viewer will be misplaced and/or wrongly
scaled.
Change-Id: Id2dd34c2dd29f5582a9f3536e6394c7e49eddf94
Task-number: QTBUG-53405
Reviewed-by: Oliver Wolff <[email protected]>
-rw-r--r-- | src/webview/qwebview_winrt.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/webview/qwebview_winrt.cpp b/src/webview/qwebview_winrt.cpp index eb78439..5895ec4 100644 --- a/src/webview/qwebview_winrt.cpp +++ b/src/webview/qwebview_winrt.cpp @@ -45,6 +45,7 @@ #include <QScreen> #include <qfunctions_winrt.h> #include <private/qeventdispatcher_winrt_p.h> +#include <private/qhighdpiscaling_p.h> #include <wrl.h> #include <windows.graphics.display.h> @@ -488,8 +489,8 @@ void QWinRTWebViewPrivate::setGeometry(const QRect &geometry) const QScreen *screen = d->window->screen(); Q_ASSERT(screen); const QPoint screenTopLeft = screen->availableGeometry().topLeft(); - const QPointF topLeft = QPointF(geometry.topLeft() + screenTopLeft) * scaleFactor; - const QSizeF size = QSizeF(geometry.size()) * scaleFactor; + const QPointF topLeft = QHighDpi::toNativePixels(QPointF(geometry.topLeft() + screenTopLeft) * scaleFactor, screen); + const QSizeF size = QHighDpi::toNativePixels(QSizeF(geometry.size()) * scaleFactor, screen); #else ResolutionScale resolutionScale; hr = d->displayInformation->get_ResolutionScale(&resolutionScale); |