diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-04-23 22:47:33 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2019-04-23 22:48:17 +0200 |
commit | e3ea01b57e93c6c686e70f07a0560250c453628b (patch) | |
tree | d2176d279325245912e1403ae3399385a16bae85 /module/util | |
parent | Replace text-flow function. (diff) | |
download | calp-e3ea01b57e93c6c686e70f07a0560250c453628b.tar.gz calp-e3ea01b57e93c6c686e70f07a0560250c453628b.tar.xz |
Change how branch length is calculated.
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) '() |