Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14156 for trunk/sources


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

##2594: Fix bug in scaling when interval is too small to be rounded to multiples of 5 or 10.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/ChartUtil.cs

    r14155 r14156  
    3737
    3838      // if one of the interval ends is a multiple of 5 or 10, change the other interval end to be a multiple as well
    39       if (((aMin % 5).IsAlmost(0) || (aMin % 10).IsAlmost(0)) && !((aMax % 5).IsAlmost(0) || (aMax % 10).IsAlmost(0))) {
    40         aMax = Math.Min(aMax + 5 - aMax % 5, aMax + 10 - aMax % 10);
    41       } else if (((aMax % 5).IsAlmost(0) || (aMax % 10).IsAlmost(0)) && !((aMin % 5).IsAlmost(0) || (aMin % 10).IsAlmost(0))) {
    42         aMin = Math.Max(aMin - aMin % 5, aMin - aMin % 10);
     39      if (decimalRank > 0) {
     40        if (((aMin % 5).IsAlmost(0) || (aMin % 10).IsAlmost(0)) && !((aMax % 5).IsAlmost(0) || (aMax % 10).IsAlmost(0))) {
     41          aMax = Math.Min(aMax + 5 - aMax % 5, aMax + 10 - aMax % 10);
     42        } else if (((aMax % 5).IsAlmost(0) || (aMax % 10).IsAlmost(0)) && !((aMin % 5).IsAlmost(0) || (aMin % 10).IsAlmost(0))) {
     43          aMin = Math.Max(aMin - aMin % 5, aMin - aMin % 10);
     44        }
    4345      }
    4446
Note: See TracChangeset for help on using the changeset viewer.