Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2160


Ignore:
Timestamp:
07/15/09 02:09:53 (15 years ago)
Author:
gkronber
Message:

Fixed #703 (Overflow error in CEDMA Bubble Chart)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChart.cs

    r2141 r2160  
    209209          if (double.IsInfinity(x) || x == double.MaxValue || x == double.MinValue) x = double.NaN;
    210210          if (double.IsInfinity(y) || y == double.MaxValue || y == double.MinValue) y = double.NaN;
    211           if (!double.IsNaN(x) && !double.IsNaN(y)) {
     211          if (!double.IsNaN(x) && !double.IsNaN(y) && IsReasonablePoint(new PointD(x,y))) {
    212212            string actualXValue = actualXValues[Math.Min(i, actualXValues.Count() - 1)].ToString();
    213213            string actualYValue = actualYValues[Math.Min(i, actualYValues.Count() - 1)].ToString();
     
    230230    }
    231231
     232    private bool IsReasonablePoint(PointD pointD) {
     233      return pointD.X > LowerLeft.X && pointD.X < UpperRight.X && pointD.Y > LowerLeft.Y && pointD.Y < UpperRight.Y;
     234    }
     235
    232236    private int CalculateSize(double size, double minSize, double maxSize) {
    233237      if (double.IsNaN(size) || double.IsInfinity(size) || size == double.MaxValue || size == double.MinValue) return minBubbleSize;
Note: See TracChangeset for help on using the changeset viewer.