Commit 1f983e59 authored by John Tapsell's avatar John Tapsell Committed by John Tapsell

Do not crash in an empty symmetric IncrementalPlot

This crash could be reproduced by starting QGroundControl, switching to
plot, then clicking the "Symmetric" checkbox.
parent 36d5aded
...@@ -214,6 +214,9 @@ void IncrementalPlot::resetScaling() ...@@ -214,6 +214,9 @@ void IncrementalPlot::resetScaling()
void IncrementalPlot::updateScale() void IncrementalPlot::updateScale()
{ {
const double margin = 0.05; const double margin = 0.05;
if(xmin == DBL_MAX)
return;
double xMinRange = xmin-(qAbs(xmin*margin)); double xMinRange = xmin-(qAbs(xmin*margin));
double xMaxRange = xmax+(qAbs(xmax*margin)); double xMaxRange = xmax+(qAbs(xmax*margin));
double yMinRange = ymin-(qAbs(ymin*margin)); double yMinRange = ymin-(qAbs(ymin*margin));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment