#5051 Do not auto zoom when adding/removing curves in plot

This commit is contained in:
Gaute Lindkvist 2019-11-27 14:03:20 +01:00
parent 42c134cbe4
commit cf190b05c1
4 changed files with 9 additions and 12 deletions

View File

@ -197,8 +197,8 @@ void RimPlotCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
{
if ( changedField == &m_showCurve )
{
this->updateCurveVisibility( true );
if ( m_showCurve() ) loadDataAndUpdate( true );
this->updateCurveVisibility();
if ( m_showCurve() ) loadDataAndUpdate( false );
}
else if ( changedField == &m_curveName )
{
@ -284,7 +284,7 @@ void RimPlotCurve::setLegendEntryText( const QString& legendEntryText )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::updateCurveVisibility( bool updateParentPlot )
void RimPlotCurve::updateCurveVisibility()
{
if ( canCurveBeAttached() )
{
@ -295,11 +295,6 @@ void RimPlotCurve::updateCurveVisibility( bool updateParentPlot )
m_qwtPlotCurve->detach();
m_qwtCurveErrorBars->detach();
}
if ( updateParentPlot )
{
updateZoomInParentPlot();
}
}
//--------------------------------------------------------------------------------------------------
@ -318,7 +313,7 @@ void RimPlotCurve::initAfterRead()
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::updateCurvePresentation( bool updatePlotLegendAndTitle )
{
this->updateCurveVisibility( updatePlotLegendAndTitle );
this->updateCurveVisibility();
if ( updatePlotLegendAndTitle )
{

View File

@ -100,7 +100,7 @@ public:
QString legendEntryText() const;
void setLegendEntryText( const QString& legendEntryText );
void updateCurveVisibility( bool updateParentPlot );
void updateCurveVisibility();
void updateLegendEntryVisibilityAndPlotLegend();
void updateLegendEntryVisibilityNoPlotUpdate();

View File

@ -1007,7 +1007,7 @@ void RimEnsembleCurveSet::updateEnsembleCurves( const std::vector<RimSummaryCase
addCurve( curve );
curve->updateCurveVisibility( false );
curve->updateCurveVisibility();
curve->loadDataAndUpdate( false );
curve->updateQwtPlotAxis();
@ -1104,7 +1104,7 @@ void RimEnsembleCurveSet::updateStatisticsCurves( const std::vector<RimSummaryCa
curve->setSummaryAddressYAndApplyInterpolation( address );
curve->setLeftOrRightAxisY( m_plotAxis() );
curve->updateCurveVisibility( false );
curve->updateCurveVisibility();
curve->loadDataAndUpdate( false );
curve->updateQwtPlotAxis();
}

View File

@ -321,6 +321,8 @@ void RiuSummaryQwtPlot::endZoomOperations()
//--------------------------------------------------------------------------------------------------
void RiuSummaryQwtPlot::onZoomedSlot()
{
plotDefinition()->setAutoScaleXEnabled( false );
plotDefinition()->setAutoScaleYEnabled( false );
plotDefinition()->updateZoomFromQwt();
}