Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11276 for branches


Ignore:
Timestamp:
08/12/14 14:34:46 (10 years ago)
Author:
pfleck
Message:

#2208 fixed OrienteeringSolutionView when score range is zero

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering.Views/3.3/OrienteeringSolutionView.cs

    r11268 r11276  
    2323using System.Drawing;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526using HeuristicLab.Core.Views;
    2627using HeuristicLab.MainForm;
     
    121122              for (int i = 0; i < points.Length; i++) {
    122123                double score = scores[i];
    123                 int size = (int)Math.Round(((score - scoreMin) / scoreRange) * 8 + 2);
     124                int size = scoreRange.IsAlmost(0.0)
     125                  ? 6
     126                  : (int)Math.Round(((score - scoreMin) / scoreRange) * 8 + 2);
    124127                graphics.FillRectangle(Brushes.Red, points[i].X - size / 2, points[i].Y - size / 2, size, size);
    125128              }
Note: See TracChangeset for help on using the changeset viewer.