summaryrefslogtreecommitdiffstats
path: root/src/pdfquick/PdfScrollablePageView.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/pdfquick/PdfScrollablePageView.qml')
-rw-r--r--src/pdfquick/PdfScrollablePageView.qml10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/pdfquick/PdfScrollablePageView.qml b/src/pdfquick/PdfScrollablePageView.qml
index 5295db7f8..9fa0547c6 100644
--- a/src/pdfquick/PdfScrollablePageView.qml
+++ b/src/pdfquick/PdfScrollablePageView.qml
@@ -1,5 +1,8 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+pragma ComponentBehavior: Bound
+
import QtQuick
import QtQuick.Controls
import QtQuick.Pdf
@@ -302,9 +305,6 @@ Flickable {
}
onRenderScaleChanged: {
- image.sourceSize.width = document.pagePointSize(pageNavigator.currentPage).width *
- renderScale * Screen.devicePixelRatio
- image.sourceSize.height = 0
paper.scale = 1
const currentLocation = Qt.point((root.contentX + root.width / 2) / root.renderScale,
(root.contentY + root.height / 2) / root.renderScale)
@@ -365,6 +365,10 @@ Flickable {
rotation: root.pageRotation
anchors.centerIn: parent
property real pageScale: image.paintedWidth / document.pagePointSize(pageNavigator.currentPage).width
+ width: document.pagePointSize(pageNavigator.currentPage).width * root.renderScale
+ height: document.pagePointSize(pageNavigator.currentPage).height * root.renderScale
+ sourceSize.width: width * Screen.devicePixelRatio
+ sourceSize.height: 0
Shape {
anchors.fill: parent