SANKORE-343. Maximum zoom was limited to 9.

preferencesAboutTextFull
Aleksei Kanash 12 years ago
parent 5ebe292112
commit 8b8fbde300
  1. 11
      src/board/UBBoardController.cpp
  2. 2
      src/core/UB.h

@ -687,9 +687,16 @@ void UBBoardController::zoom(const qreal ratio, QPointF scenePoint)
QPointF offset = scenePoint - viewCenter;
QPointF scalledOffset = offset / ratio;
mControlView->scale(ratio, ratio);
qreal currentZoom = ratio * mControlView->viewportTransform().m11() / mSystemScaleFactor;
qreal currentZoom = mControlView->viewportTransform().m11() / mSystemScaleFactor;
qreal usedRatio = ratio;
if (currentZoom > UB_MAX_ZOOM)
{
currentZoom = UB_MAX_ZOOM;
usedRatio = currentZoom * mSystemScaleFactor / mControlView->viewportTransform().m11();
}
mControlView->scale(usedRatio, usedRatio);
QPointF newCenter = scenePoint - scalledOffset;

@ -18,7 +18,7 @@
#include <QtGui>
#define UB_MAX_ZOOM 15
#define UB_MAX_ZOOM 9
struct UBMimeType
{

Loading…
Cancel
Save