Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14157


Ignore:
Timestamp:
07/21/16 16:11:03 (8 years ago)
Author:
bburlacu
Message:

#2597: Avoid calling CalculateAxesInterval when the interval is invalid.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/GradientChart.cs

    r14131 r14157  
    335335
    336336    private void SetupAxis(Axis axis, double minValue, double maxValue, int ticks, double? fixedAxisMin, double? fixedAxisMax) {
    337       double axisMin, axisMax, axisInterval;
    338       ChartUtil.CalculateAxisInterval(minValue, maxValue, ticks, out axisMin, out axisMax, out axisInterval);
    339       axis.Minimum = fixedAxisMin ?? axisMin;
    340       axis.Maximum = fixedAxisMax ?? axisMax;
    341       axis.Interval = (axis.Maximum - axis.Minimum) / ticks;
     337      if (minValue < maxValue) {
     338        double axisMin, axisMax, axisInterval;
     339        ChartUtil.CalculateAxisInterval(minValue, maxValue, ticks, out axisMin, out axisMax, out axisInterval);
     340        axis.Minimum = fixedAxisMin ?? axisMin;
     341        axis.Maximum = fixedAxisMax ?? axisMax;
     342        axis.Interval = (axis.Maximum - axis.Minimum) / ticks;
     343      }
    342344
    343345      try {
Note: See TracChangeset for help on using the changeset viewer.