aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp b/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
index 7c0fd323..63d25be4 100644
--- a/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
+++ b/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
@@ -315,3 +315,19 @@ void PrintWidget::fit(bool doFitting) {
//zoomFactor = this->transform().m11() * (float(printer->logicalDpiY()) / this->logicalDpiY());
}
+
+void PrintWidget::goToPosition(int pagenum, float x, float y) {
+ setCurrentPage(pagenum+1);
+ QPointF pt = this->transform().map(pages.at(pagenum)->pos());
+
+ if (zoomMode != FitInView) {
+ if(x != 0) {
+ QScrollBar *hsc = this->horizontalScrollBar();
+ hsc->setValue(int(pt.x() + x) - 10);
+ }
+ if(y != 0) {
+ QScrollBar *vsc = this->verticalScrollBar();
+ vsc->setValue(int(pt.y() + y) - 10);
+ }
+ }
+}
bgstack15