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,14 +160,27 @@ const RigWellLogCurveData* RimWellLogCurve::curveData() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellLogCurve::updateZoomInParentPlot()
|
void RimWellLogCurve::updateZoomInParentPlot()
|
||||||
{
|
{
|
||||||
|
const double eps = 1.0e-8;
|
||||||
|
|
||||||
RimWellLogPlot* wellLogPlot;
|
RimWellLogPlot* wellLogPlot;
|
||||||
firstAncestorOrThisOfType( wellLogPlot );
|
firstAncestorOrThisOfType( wellLogPlot );
|
||||||
if ( wellLogPlot )
|
if ( wellLogPlot )
|
||||||
|
{
|
||||||
|
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->setAutoScaleYEnabled( true );
|
||||||
wellLogPlot->updateZoom();
|
wellLogPlot->updateZoom();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user