From ca8949f82fa76ee8a874a322790d207ab24b2994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Tue, 21 Nov 2017 11:46:26 +0100 Subject: [PATCH] fixed handscroll on extended screen --- src/core/UBApplicationController.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index 030a0da0..d8bdc89f 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -233,12 +233,15 @@ void UBApplicationController::adjustDisplayView() tr.scale(scaleFactor, scaleFactor); + QRect rect = mControlView->rect(); + QPoint center(rect.x() + rect.width() / 2, rect.y() + rect.height() / 2); + QTransform recentTransform = mDisplayView->transform(); if (recentTransform != tr) mDisplayView->setTransform(tr); - mDisplayView->centerOn(UBApplication::boardController->activeScene()->lastCenter()); + mDisplayView->centerOn(mControlView->mapToScene(center)); } }