#5150 Improve wheel zoom with logarithmic axes

* Limit the amount to scroll at one time and set a fixed minimum
This commit is contained in:
Gaute Lindkvist
2019-11-30 12:08:42 +01:00
parent 538e42f278
commit 4870071b8e
5 changed files with 70 additions and 6 deletions

View File

@@ -112,9 +112,9 @@ RiuSummaryQwtPlot::RiuSummaryQwtPlot( RimPlot* plotDefinition, QWidget* parent /
QwtPlotPanner* panner = new QwtPlotPanner( canvas() );
panner->setMouseButton( Qt::MidButton );
auto wheelZoomer = new RiuQwtPlotWheelZoomer( this );
m_wheelZoomer = new RiuQwtPlotWheelZoomer( this );
connect( wheelZoomer, SIGNAL( zoomUpdated() ), SLOT( onZoomedSlot() ) );
connect( m_wheelZoomer, SIGNAL( zoomUpdated() ), SLOT( onZoomedSlot() ) );
connect( m_zoomerLeft, SIGNAL( zoomed( const QRectF& ) ), SLOT( onZoomedSlot() ) );
connect( m_zoomerRight, SIGNAL( zoomed( const QRectF& ) ), SLOT( onZoomedSlot() ) );
connect( panner, SIGNAL( panned( int, int ) ), SLOT( onZoomedSlot() ) );
@@ -245,6 +245,14 @@ void RiuSummaryQwtPlot::setLegendVisible( bool visible )
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuSummaryQwtPlot::setAxisIsLogarithmic( QwtPlot::Axis axis, bool logarithmic )
{
if ( m_wheelZoomer ) m_wheelZoomer->setAxisIsLogarithmic( axis, logarithmic );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------