0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-11-25 08:28:06 +03:00

page scale refactored

This commit is contained in:
Arin Alexander
2016-04-06 00:06:11 +04:00
parent aa3f9d80d3
commit 79feedd360
7 changed files with 19 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
#include "lrgraphicsviewzoom.h"
#include <QMouseEvent>
#include <QApplication>
#include <QtMath>
#include <qmath.h>
namespace LimeReport{
@@ -11,7 +11,7 @@ GraphicsViewZoomer::GraphicsViewZoomer(QGraphicsView* view)
m_view->viewport()->installEventFilter(this);
m_view->setMouseTracking(true);
m_modifiers = Qt::ControlModifier;
m_zoomFactorBase = 1.0015;
m_zoomFactorBase = 1.0009;
}
void GraphicsViewZoomer::gentleZoom(double factor) {
@@ -21,7 +21,7 @@ void GraphicsViewZoomer::gentleZoom(double factor) {
m_view->viewport()->height() / 2.0);
QPointF viewport_center = m_view->mapFromScene(m_targetScenePos) - delta_viewport_pos;
m_view->centerOn(m_view->mapToScene(viewport_center.toPoint()));
emit zoomed();
emit zoomed(factor);
}
void GraphicsViewZoomer::setModifiers(Qt::KeyboardModifiers modifiers) {