#1366 Wheel works without Ctrl pressed

This commit is contained in:
Jacob Støren 2017-03-27 18:22:09 +02:00
parent 0c834cdc0f
commit 233c248491

View File

@ -53,23 +53,21 @@ bool RiuQwtPlotWheelZoomer::eventFilter(QObject * watched, QEvent * event)
QWheelEvent* wheelEvent = dynamic_cast<QWheelEvent*>(event);
if ( wheelEvent )
{
if ( wheelEvent->modifiers() )
double zoomFactor = 1.0/RIU_SCROLLWHEEL_ZOOMFACTOR;
if ( wheelEvent->delta() > 0 )
{
double zoomFactor = 1.0/RIU_SCROLLWHEEL_ZOOMFACTOR;
if ( wheelEvent->delta() > 0 )
{
zoomFactor = RIU_SCROLLWHEEL_ZOOMFACTOR;
}
zoomOnAxis(m_plot, QwtPlot::xBottom, zoomFactor, wheelEvent->pos().x());
zoomOnAxis(m_plot, QwtPlot::xTop, zoomFactor, wheelEvent->pos().x());
zoomOnAxis(m_plot, QwtPlot::yLeft, zoomFactor, wheelEvent->pos().y());
zoomOnAxis(m_plot, QwtPlot::yRight, zoomFactor, wheelEvent->pos().y());
m_plot->replot();
emit zoomUpdated();
zoomFactor = RIU_SCROLLWHEEL_ZOOMFACTOR;
}
zoomOnAxis(m_plot, QwtPlot::xBottom, zoomFactor, wheelEvent->pos().x());
zoomOnAxis(m_plot, QwtPlot::xTop, zoomFactor, wheelEvent->pos().x());
zoomOnAxis(m_plot, QwtPlot::yLeft, zoomFactor, wheelEvent->pos().y());
zoomOnAxis(m_plot, QwtPlot::yRight, zoomFactor, wheelEvent->pos().y());
m_plot->replot();
emit zoomUpdated();
}
return false;
}