diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-06-06 14:06:12 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2018-06-06 16:17:58 +0000 |
commit | 231ec324472b3f279bab61d22f3f82cfc0de8b7d (patch) | |
tree | 2885df99c0dad1f1df8502f80f99d942d5abf7e6 /src/core/delegated_frame_node.cpp | |
parent | 0ea0555d4b54db40efb597444ea4d9e65c49690b (diff) |
Fix crash with non-integer Qt scaling
We could end up dropping visible blocks during scrolling if only one
pixel line was left and the viewport got rounding one line too small.
Task-number: QTBUG-68699
Change-Id: I1ab646f23d8dd4911b32d02df68c80d6a8d78651
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/core/delegated_frame_node.cpp')
-rw-r--r-- | src/core/delegated_frame_node.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp index eed407a09..c0f515ad8 100644 --- a/src/core/delegated_frame_node.cpp +++ b/src/core/delegated_frame_node.cpp @@ -852,7 +852,8 @@ void DelegatedFrameNode::commit(ChromiumCompositorData *chromiumCompositorData, QScopedPointer<DelegatedNodeTreeHandler> nodeHandler; const QSizeF viewportSizeInPt = apiDelegate->screenRect().size(); - const QSize viewportSize = (viewportSizeInPt * devicePixelRatio).toSize(); + const QSizeF viewportSizeF = viewportSizeInPt * devicePixelRatio; + const QSize viewportSize(std::ceil(viewportSizeF.width()), std::ceil(viewportSizeF.height())); // We first compare if the render passes from the previous frame data are structurally // equivalent to the render passes in the current frame data. If they are, we are going |