Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/12/14 00:49:17 (10 years ago)
Author:
bburlacu
Message:

#1772: Small temporary fix to index out of bounds error in FragmentGraphView.cs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/FragmentGraphView.cs

    r10838 r10840  
    125125          var parent = node.Parents.First();
    126126          var index = fragment.Index1 + (parent.Content.Index2 - parent.Content.Index1);
    127           var subtree = fragment.Root.NodeAt(index);
    128           var primitive = aTile.GetPrimitive(subtree);
    129           primitive.Brush = new SolidBrush(Color.LightCoral);
     127          // some mutations create discontinuities which invalidate the index
     128          if (index >= 0 && index < fragment.Root.GetLength()) {
     129            var subtree = fragment.Root.NodeAt(index);
     130            var primitive = aTile.GetPrimitive(subtree);
     131            primitive.Brush = new SolidBrush(Color.LightCoral);
     132          }
    130133        }
    131134
     
    139142          };
    140143          symbolicExpressionChartControl.Add(line);
    141 
    142           //          if (child == node.Children.First()) {
    143           //            var subtree = child.Content.Root.NodeAt(fragment.Index2);
    144           //            var primitive = bTile.GetPrimitive(subtree);
    145           //            if (primitive != null) {
    146           //              var rpb = primitive as RectangularPrimitiveBase;
    147           //              if (rpb != null) {
    148           //                rpb.Pen = new Pen(Color.RoyalBlue);
    149           //              }
    150           //            }
    151           //          }
    152144        }
    153145      }
Note: See TracChangeset for help on using the changeset viewer.