diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2022-04-20 09:02:50 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2022-04-22 07:57:53 +0200 |
commit | 350f2f5d488af018c7c1c6d97fc8ba5b40125e8f (patch) | |
tree | de0cf117c0cef2d1a8e4cee1e883416cf1019ef7 /src/pdfquick | |
parent | dc0eff5dcda8bf110031eb67e04daab110cdaea0 (diff) | |
download | qtwebengine-350f2f5d488af018c7c1c6d97fc8ba5b40125e8f.tar.gz |
PdfMultiPageView: fix PdfNavigationStack.onJumped horizontal scrolling
xOffsetLimit should not be divided by 2: it's meant to be the farthest
that we can scroll to the right without going beyond the page edge.
Since we still have the tableView.rebuild() workaround function, remove
some calls to forceLayout() that seem not to help with anything, but
just caused a warning:
Cannot do an immediate re-layout during an ongoing layout!
Pick-to: 6.3
Fixes: QTBUG-102742
Change-Id: I57f419467e01fc92c12e5d74262d8fa878ce1c79
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/pdfquick')
-rw-r--r-- | src/pdfquick/PdfMultiPageView.qml | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/pdfquick/PdfMultiPageView.qml b/src/pdfquick/PdfMultiPageView.qml index bf4cb4602..2457c5010 100644 --- a/src/pdfquick/PdfMultiPageView.qml +++ b/src/pdfquick/PdfMultiPageView.qml @@ -198,7 +198,6 @@ Item { if (zoom > 0) { navigationStack.jumping = true // don't call navigationStack.update() because we will jump() instead root.renderScale = zoom - tableView.forceLayout() // but do ensure that the table layout is correct before we try to jump navigationStack.jumping = false } navigationStack.jump(page, location, zoom) // actually jump @@ -390,7 +389,6 @@ Item { image.sourceSize.height = 0 paper.scale = 1 searchHighlights.update() - tableView.forceLayout() } onStatusChanged: { if (index === navigationStack.currentPage) @@ -629,7 +627,7 @@ Item { var pageSize = root.document.pagePointSize(page) pageSize.width *= root.renderScale pageSize.height *= root.renderScale - const xOffsetLimit = Math.max(0, pageSize.width - root.width) / 2 + const xOffsetLimit = Math.max(0, pageSize.width - root.width) const offset = Qt.point(Math.max(-xOffsetLimit, Math.min(xOffsetLimit, location.x * root.renderScale - tableView.jumpLocationMargin.x)), Math.max(0, location.y * root.renderScale - tableView.jumpLocationMargin.y)) |