Decline curve: remove time selection annotation when curve is hidden

This commit is contained in:
Kristian Bendiksen 2023-06-16 13:15:38 +02:00
parent 06b5c9afbf
commit 413da2e714
2 changed files with 5 additions and 1 deletions

View File

@ -723,6 +723,10 @@ void RimSummaryCurve::onLoadDataAndUpdate( bool updateParentPlot )
replotParentPlot();
}
}
else
{
updateTimeAnnotations();
}
if ( updateParentPlot ) updateAxisInPlot( axisY() );
}

View File

@ -420,7 +420,7 @@ void RimSummaryDeclineCurve::updateTimeAnnotations()
auto plot = firstAncestorOrThisOfTypeAsserted<RimSummaryPlot>();
if ( m_timeRangeAnnotation ) plot->removeTimeAnnotation( m_timeRangeAnnotation );
if ( m_showTimeSelectionInPlot )
if ( m_showTimeSelectionInPlot && isChecked() )
{
m_timeRangeAnnotation = plot->addTimeRangeAnnotation( m_minTimeStep, m_maxTimeStep );
m_timeRangeAnnotation->setColor( color() );