#5305 Only update parent plot zoom when changing well log curve if the data range changes

This commit is contained in:
Gaute Lindkvist 2020-01-08 11:03:45 +01:00
parent cd0edd084d
commit fdb453a813

View File

@ -160,13 +160,26 @@ 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();
} }
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------