mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5305 Only update parent plot zoom when changing well log curve if the data range changes
This commit is contained in:
parent
cd0edd084d
commit
fdb453a813
@ -160,12 +160,25 @@ const RigWellLogCurveData* RimWellLogCurve::curveData() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogCurve::updateZoomInParentPlot()
|
||||
{
|
||||
const double eps = 1.0e-8;
|
||||
|
||||
RimWellLogPlot* wellLogPlot;
|
||||
firstAncestorOrThisOfType( wellLogPlot );
|
||||
if ( wellLogPlot )
|
||||
{
|
||||
wellLogPlot->setAutoScaleYEnabled( true );
|
||||
wellLogPlot->updateZoom();
|
||||
double minPlotDepth, maxPlotDepth;
|
||||
wellLogPlot->availableDepthRange( &minPlotDepth, &maxPlotDepth );
|
||||
double plotRange = std::abs( maxPlotDepth - minPlotDepth );
|
||||
double minCurveDepth, maxCurveDepth;
|
||||
m_curveData->calculateDepthRange( wellLogPlot->depthType(),
|
||||
wellLogPlot->depthUnit(),
|
||||
&minCurveDepth,
|
||||
&maxCurveDepth );
|
||||
if ( minCurveDepth < minPlotDepth - eps * plotRange || maxCurveDepth > maxPlotDepth + eps * plotRange )
|
||||
{
|
||||
wellLogPlot->setAutoScaleYEnabled( true );
|
||||
wellLogPlot->updateZoom();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user