diff options
Diffstat (limited to '')
-rw-r--r-- | module/util/tree.scm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/module/util/tree.scm b/module/util/tree.scm index 103888cc..8d3e7805 100644 --- a/module/util/tree.scm +++ b/module/util/tree.scm @@ -27,8 +27,11 @@ ;; Length includes current node, so the length of a leaf is 1. (define (length-of-longst-branch tree) (if (null? tree) - 0 (1+ (max (length-of-longst-branch (left-subtree tree)) - (length-of-longst-branch (right-subtree tree)))))) + ;; Having the @var{1+} outside the @var{max} also works, + ;; but leads to events overlapping many other to be thinner. + ;; Having it inside makes all events as evenly wide as possible. + 0 (max (1+ (length-of-longst-branch (left-subtree tree))) + (length-of-longst-branch (right-subtree tree))))) (define (tree-map proc tree) (if (null? tree) '() |