Skip to content

Commit

Permalink
Don't crash on crazy time axis values
Browse files Browse the repository at this point in the history
Instead just draw a blank axis.
Crazy is defined as  t>1E150 years.
  • Loading branch information
netterfield committed Jun 12, 2016
1 parent aed7a9c commit dc74268
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/libkstapp/plotaxis.cpp
Expand Up @@ -825,7 +825,16 @@ void PlotAxis::updateInterpretTicks(MajorTickMode tickMode) {
double minimum_units = tickMode;

// find base_jd, range_u, units
if (range_jd > minimum_units*365.0) {
double valid = true;
if (range_jd > minimum_units*365.0*1.0e150) {
_ticksUpdated = true;
_axisLabels.clear();
_axisMinorTicks.clear();
_axisMajorTicks.clear();
_baseLabel.clear();
return;

} else if (range_jd > minimum_units*365.0) {
// use years
range_u = range_jd/365.25;
units = tr(" [Years]");
Expand Down

0 comments on commit dc74268

Please sign in to comment.