|
|
|
@ -1519,6 +1519,10 @@ void UBBoardController::updateSystemScaleFactor() |
|
|
|
|
if (mActiveScene) |
|
|
|
|
{ |
|
|
|
|
QSize pageNominalSize = mActiveScene->nominalSize(); |
|
|
|
|
//we're going to keep scale factor untouched if the size is custom
|
|
|
|
|
QMap<DocumentSizeRatio::Enum, QSize> sizesMap = UBSettings::settings()->documentSizes; |
|
|
|
|
if(pageNominalSize == sizesMap.value(DocumentSizeRatio::Ratio16_9) || pageNominalSize == sizesMap.value(DocumentSizeRatio::Ratio4_3)) |
|
|
|
|
{ |
|
|
|
|
QSize controlSize = controlViewport(); |
|
|
|
|
|
|
|
|
|
qreal hFactor = ((qreal)controlSize.width()) / ((qreal)pageNominalSize.width()); |
|
|
|
@ -1526,6 +1530,7 @@ void UBBoardController::updateSystemScaleFactor() |
|
|
|
|
|
|
|
|
|
newScaleFactor = qMin(hFactor, vFactor); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (mSystemScaleFactor != newScaleFactor) |
|
|
|
|
{ |
|
|
|
@ -1543,7 +1548,6 @@ void UBBoardController::updateSystemScaleFactor() |
|
|
|
|
mControlView->setTransform(scalingTransform); |
|
|
|
|
mControlView->horizontalScrollBar()->setValue(viewState.horizontalPosition); |
|
|
|
|
mControlView->verticalScrollBar()->setValue(viewState.verticalPostition); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|