fixes 0003222: Invert zoom setting is not respected in paper/page mode
This commit is contained in:
@@ -71,6 +71,7 @@ SvgView::SvgView(QWidget *parent)
|
||||
, m_svgItem(0)
|
||||
, m_backgroundItem(0)
|
||||
, m_outlineItem(0)
|
||||
, m_invertZoom(false)
|
||||
{
|
||||
setScene(new QGraphicsScene(this));
|
||||
setTransformationAnchor(AnchorUnderMouse);
|
||||
@@ -196,7 +197,10 @@ void SvgView::paintEvent(QPaintEvent *event)
|
||||
|
||||
void SvgView::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
qreal factor = std::pow(1.2, -event->delta() / 240.0);
|
||||
int delta = -event->delta();
|
||||
if (m_invertZoom)
|
||||
delta = -delta;
|
||||
qreal factor = std::pow(1.2, delta / 240.0);
|
||||
scale(factor, factor);
|
||||
event->accept();
|
||||
}
|
||||
@@ -253,6 +257,11 @@ DrawingView::DrawingView(Gui::Document* doc, QWidget* parent)
|
||||
|
||||
m_orientation = QPrinter::Landscape;
|
||||
m_pageSize = QPrinter::A4;
|
||||
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/View");
|
||||
bool on = hGrp->GetBool("InvertZoom", false);
|
||||
m_view->setZoomInverted(on);
|
||||
}
|
||||
|
||||
DrawingView::~DrawingView()
|
||||
|
||||
@@ -55,6 +55,9 @@ public:
|
||||
void openFile(const QFile &file);
|
||||
void setRenderer(RendererType type = Native);
|
||||
void drawBackground(QPainter *p, const QRectF &rect);
|
||||
void setZoomInverted(bool on) {
|
||||
m_invertZoom = on;
|
||||
}
|
||||
|
||||
public Q_SLOTS:
|
||||
void setHighQualityAntialiasing(bool highQualityAntialiasing);
|
||||
@@ -73,6 +76,7 @@ private:
|
||||
QGraphicsRectItem *m_outlineItem;
|
||||
|
||||
QImage m_image;
|
||||
bool m_invertZoom;
|
||||
};
|
||||
|
||||
class DrawingGuiExport DrawingView : public Gui::MDIView
|
||||
|
||||
Reference in New Issue
Block a user