Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
Aleksei Kanash 13 years ago
commit 650346f715
  1. 14
      src/board/UBBoardController.cpp

@ -1519,12 +1519,17 @@ void UBBoardController::updateSystemScaleFactor()
if (mActiveScene) if (mActiveScene)
{ {
QSize pageNominalSize = mActiveScene->nominalSize(); QSize pageNominalSize = mActiveScene->nominalSize();
QSize controlSize = controlViewport(); //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()); qreal hFactor = ((qreal)controlSize.width()) / ((qreal)pageNominalSize.width());
qreal vFactor = ((qreal)controlSize.height()) / ((qreal)pageNominalSize.height()); qreal vFactor = ((qreal)controlSize.height()) / ((qreal)pageNominalSize.height());
newScaleFactor = qMin(hFactor, vFactor); newScaleFactor = qMin(hFactor, vFactor);
}
} }
if (mSystemScaleFactor != newScaleFactor) if (mSystemScaleFactor != newScaleFactor)
@ -1543,7 +1548,6 @@ void UBBoardController::updateSystemScaleFactor()
mControlView->setTransform(scalingTransform); mControlView->setTransform(scalingTransform);
mControlView->horizontalScrollBar()->setValue(viewState.horizontalPosition); mControlView->horizontalScrollBar()->setValue(viewState.horizontalPosition);
mControlView->verticalScrollBar()->setValue(viewState.verticalPostition); mControlView->verticalScrollBar()->setValue(viewState.verticalPostition);
} }

Loading…
Cancel
Save