diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2022-02-07 15:42:06 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-02-08 19:47:45 +0000 |
commit | 5474edbc17899ec377e93ffba9f61ead0c55f172 (patch) | |
tree | 813c6692d1e758ec07f1333c629b3f8adcdfc24f /src/pdfquick/qml | |
parent | 470da803923de132e5ba6badac951fb3f8bf8224 (diff) |
QQuickPdfSelection: Fix division by zero
QQuickPdfSelection::m_renderScale is used for division in
QQuickPdfSelection::updateResults(). Add warning message to
setRenderScale() and ignore the new value if it is zero.
Also avoid setting PdfSelection.renderScale to zero in
PdfScrollablePageView.
The division caused an assert:
ASSERT: "divisor < 0 || divisor > 0" in file qtbase/src/corelib/tools/qpoint.h, line 299
It was reproducible with the pdfviewer quick example.
Change-Id: I31e08a9a28392fcc132470c8d94af1307447565a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 4f7b7995552b0220a9e431266e0119cd03a233cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/pdfquick/qml')
-rw-r--r-- | src/pdfquick/qml/PdfScrollablePageView.qml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pdfquick/qml/PdfScrollablePageView.qml b/src/pdfquick/qml/PdfScrollablePageView.qml index aea1a70c2..ba8c8fb2a 100644 --- a/src/pdfquick/qml/PdfScrollablePageView.qml +++ b/src/pdfquick/qml/PdfScrollablePageView.qml @@ -261,7 +261,7 @@ Flickable { anchors.fill: parent document: root.document page: navigationStack.currentPage - renderScale: image.pageScale + renderScale: image.pageScale == 0 ? 1.0 : image.pageScale fromPoint: textSelectionDrag.centroid.pressPosition toPoint: textSelectionDrag.centroid.position hold: !textSelectionDrag.active && !mouseClickHandler.pressed |