Changeset 15040
- Timestamp:
- 06/21/17 10:56:18 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs
r15029 r15040 37 37 private ILayoutEngine<ISymbolicExpressionTreeNode> layoutEngine; 38 38 39 private const int preferredNodeWidth = 70; 40 private const int preferredNodeHeight = 46; 39 private int preferredNodeWidth = 70; 40 public int PreferredNodeWidth { 41 get { return preferredNodeWidth; } 42 set { preferredNodeWidth = value; } 43 } 44 45 private int preferredNodeHeight = 46; 46 public int PreferredNodeHeight { 47 get { return preferredNodeHeight; } 48 set { preferredNodeHeight = value; } 49 } 50 41 51 private int minHorizontalDistance = 30; 52 public int MinimumHorizontalDistance { 53 get { return minHorizontalDistance; } 54 set { minHorizontalDistance = value; } 55 } 56 42 57 private int minVerticalDistance = 30; 58 public int MinimumVerticalDistance { 59 get { return minVerticalDistance; } 60 set { minVerticalDistance = value; } 61 } 62 63 private int minHorizontalPadding = 20; 64 public int MinimumHorizontalPadding { 65 get { return minHorizontalPadding; } 66 set { minHorizontalPadding = value; } 67 } 68 69 private int minVerticalPadding = 20; 70 public int MinimumVerticalPadding { 71 get { return minVerticalPadding; } 72 set { minVerticalPadding = value; } 73 } 43 74 44 75 public SymbolicExpressionTreeChart() { … … 287 318 actualRoot = tree.Root.GetSubtree(0); 288 319 } 289 var paddingX = 20; // add 10px padding on each side (left and right) 290 var paddingY = 20; // add 10px padding on top and bottom 291 var visualNodes = layoutEngine.CalculateLayout(actualRoot, Width - paddingX, Height - paddingY).ToList(); 320 var visualNodes = layoutEngine.CalculateLayout(actualRoot, Width - minHorizontalPadding, Height - minVerticalPadding).ToList(); 292 321 // add the padding 293 322 foreach (var vn in visualNodes) { 294 vn.X += paddingX/ 2;295 vn.Y += paddingY/ 2;323 vn.X += minHorizontalPadding / 2; 324 vn.Y += minVerticalPadding / 2; 296 325 } 297 326
Note: See TracChangeset
for help on using the changeset viewer.