mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix log axis crash in Grid Cross Plot and refactor log axis range code
This commit is contained in:
@@ -635,32 +635,25 @@ void RimSummaryPlot::updateZoomForAxis(RiaDefines::PlotAxis plotAxis)
|
||||
{
|
||||
if (yAxisProps->isLogarithmicScaleEnabled)
|
||||
{
|
||||
std::vector<double> yValues;
|
||||
std::vector<QwtPlotCurve*> plotCurves;
|
||||
std::vector<const QwtPlotCurve*> plotCurves;
|
||||
|
||||
for (RimSummaryCurve* c : visibleSummaryCurvesForAxis(plotAxis))
|
||||
{
|
||||
std::vector<double> curveValues = c->valuesY();
|
||||
yValues.insert(yValues.end(), curveValues.begin(), curveValues.end());
|
||||
plotCurves.push_back(c->qwtPlotCurve());
|
||||
}
|
||||
|
||||
for (RimGridTimeHistoryCurve* c : visibleTimeHistoryCurvesForAxis(plotAxis))
|
||||
{
|
||||
std::vector<double> curveValues = c->yValues();
|
||||
yValues.insert(yValues.end(), curveValues.begin(), curveValues.end());
|
||||
plotCurves.push_back(c->qwtPlotCurve());
|
||||
}
|
||||
|
||||
for (RimAsciiDataCurve* c : visibleAsciiDataCurvesForAxis(plotAxis))
|
||||
{
|
||||
std::vector<double> curveValues = c->yValues();
|
||||
yValues.insert(yValues.end(), curveValues.begin(), curveValues.end());
|
||||
plotCurves.push_back(c->qwtPlotCurve());
|
||||
}
|
||||
|
||||
double min, max;
|
||||
RimPlotAxisRangeCalculator calc(QwtPlot::yLeft, plotCurves, yValues);
|
||||
RimPlotAxisLogRangeCalculator calc(QwtPlot::yLeft, plotCurves);
|
||||
calc.computeAxisRange(&min, &max);
|
||||
|
||||
if (yAxisProps->isAxisInverted())
|
||||
|
||||
Reference in New Issue
Block a user