mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5178 Fix axis rounding on plots other than Well Log Plots
This commit is contained in:
@@ -65,7 +65,7 @@ RiuQwtPlotWidget::RiuQwtPlotWidget( RimPlot* plot, QWidget* parent )
|
||||
, m_plotDefinition( plot )
|
||||
, m_draggable( true )
|
||||
{
|
||||
setDefaults();
|
||||
RiuQwtPlotTools::setCommonPlotBehaviour( this );
|
||||
|
||||
this->installEventFilter( this );
|
||||
this->canvas()->installEventFilter( this );
|
||||
@@ -161,34 +161,6 @@ RimPlot* RiuQwtPlotWidget::plotDefinition() const
|
||||
return m_plotDefinition;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuQwtPlotWidget::setEnabledAxes( const std::set<QwtPlot::Axis> enabledAxes )
|
||||
{
|
||||
for ( int axisId = 0; axisId < QwtPlot::axisCnt; ++axisId )
|
||||
{
|
||||
QwtPlot::Axis axis = static_cast<QwtPlot::Axis>( axisId );
|
||||
if ( enabledAxes.count( axis ) )
|
||||
{
|
||||
enableAxis( axis, true );
|
||||
// Align the canvas with the actual min and max values of the curves
|
||||
axisScaleEngine( axis )->setAttribute( QwtScaleEngine::Floating, true );
|
||||
setAxisScale( axis, 0.0, 100.0 );
|
||||
axisScaleDraw( axis )->setMinimumExtent( axisExtent( axis ) );
|
||||
setMinimumWidth( defaultMinimumWidth() );
|
||||
|
||||
axisWidget( axis )->setMargin( 0 );
|
||||
m_axisTitlesEnabled[axis] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
enableAxis( axis, false );
|
||||
m_axisTitlesEnabled[axis] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -704,15 +676,6 @@ void RiuQwtPlotWidget::updateOverlayFrameLayout()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuQwtPlotWidget::setDefaults()
|
||||
{
|
||||
setEnabledAxes( {QwtPlot::xTop, QwtPlot::yLeft} );
|
||||
RiuQwtPlotTools::setCommonPlotBehaviour( this );
|
||||
}
|
||||
|
||||
void RiuQwtPlotWidget::selectPlotOwner( bool toggleItemInSelection )
|
||||
{
|
||||
if ( toggleItemInSelection )
|
||||
|
||||
Reference in New Issue
Block a user