Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/ReingoldTilfordLayoutEngine.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/ReingoldTilfordLayoutEngine.cs	(revision 15026)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/LayoutEngines/ReingoldTilfordLayoutEngine.cs	(revision 15029)
@@ -40,5 +40,5 @@
       SecondWalk(layoutRoot, -layoutRoot.Prelim);
       NormalizeCoordinates(layoutNodeMap.Values);
-      if (height != 0 && width != 0) {
+      if (width > 0 && height > 0) {
         FitToBounds(width, height, layoutNodeMap.Values);
         Center(width, height, layoutNodeMap.Values);
@@ -158,5 +158,5 @@
         if (ymax < y) ymax = y;
       }
-      return new RectangleF(xmin, ymin, xmax + minHorizontalSpacing + NodeWidth, ymax + minVerticalSpacing + NodeHeight);
+      return new RectangleF(xmin, ymin, xmax + NodeWidth, ymax + NodeHeight);
     }
 
Index: trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs
===================================================================
--- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs	(revision 15026)
+++ trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs	(revision 15029)
@@ -287,6 +287,13 @@
         actualRoot = tree.Root.GetSubtree(0);
       }
-
-      var visualNodes = layoutEngine.CalculateLayout(actualRoot, Width, Height).ToList();
+      var paddingX = 20; // add 10px padding on each side (left and right)
+      var paddingY = 20; // add 10px padding on top and bottom
+      var visualNodes = layoutEngine.CalculateLayout(actualRoot, Width - paddingX, Height - paddingY).ToList();
+      // add the padding
+      foreach (var vn in visualNodes) {
+        vn.X += paddingX / 2;
+        vn.Y += paddingY / 2;
+      }
+
       visualTreeNodes = visualNodes.ToDictionary(x => x.Content, x => x);
       visualLines = new Dictionary<Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>, VisualTreeNodeConnection>();
@@ -321,4 +328,6 @@
     }
 
+    private Action<Brush, int, int, int, int> fill;
+    private Action<Pen, int, int, int, int> draw;
     protected void DrawTreeNode(Graphics graphics, VisualTreeNode<ISymbolicExpressionTreeNode> visualTreeNode) {
       graphics.Clip = new Region(new Rectangle(visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width + 1, visualTreeNode.Height + 1));
@@ -328,15 +337,18 @@
       using (var nodeLinePen = new Pen(visualTreeNode.LineColor))
       using (var nodeFillBrush = new SolidBrush(visualTreeNode.FillColor)) {
-        //draw terminal node
-        if (node.SubtreeCount == 0) {
-          graphics.FillRectangle(nodeFillBrush, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
-          graphics.DrawRectangle(nodeLinePen, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
+        var x = visualTreeNode.X;
+        var y = visualTreeNode.Y;
+        var w = visualTreeNode.Width - 1;  // allow 1px for the drawing of the line
+        var h = visualTreeNode.Height - 1; // allow 1px for the drawing of the line
+        // draw leaf nodes as rectangles and internal nodes as ellipses
+        if (node.SubtreeCount > 0) {
+          fill = graphics.FillEllipse; draw = graphics.DrawEllipse;
         } else {
-          graphics.FillEllipse(nodeFillBrush, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
-          graphics.DrawEllipse(nodeLinePen, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
-        }
+          fill = graphics.FillRectangle; draw = graphics.DrawRectangle;
+        }
+        fill(nodeFillBrush, x, y, w, h);
+        draw(nodeLinePen, x, y, w, h);
         //draw name of symbol
-        var text = node.ToString();
-        graphics.DrawString(text, textFont, textBrush, new RectangleF(visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height), stringFormat);
+        graphics.DrawString(node.ToString(), textFont, textBrush, new RectangleF(x, y, w, h), stringFormat);
       }
     }
