]> git.donarmstrong.com Git - lilypond.git/commitdiff
\markuplines: fix space between \justified-lines groups
authorNicolas Sceaux <nicolas.sceaux@free.fr>
Mon, 14 Jul 2008 10:39:23 +0000 (12:39 +0200)
committerNicolas Sceaux <nicolas.sceaux@free.fr>
Mon, 14 Jul 2008 10:39:23 +0000 (12:39 +0200)
space-lines: Also add space around the first and last lines of a
group, so that the spacing between paragraphs is even wrt to the
spacing inside a paragraph.

scm/define-markup-commands.scm

index 8d956b3b5654b97325d2d4a817d25c6a1ec9352f..34541d55487bdf464eae8292de553299c8adc21b 100644 (file)
@@ -2978,25 +2978,25 @@ when @var{label} is not found."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-public (space-lines baseline stils)
-  (let space-stil ((prev-stil #f)
-                  (stils stils)
+  (let space-stil ((stils stils)
                   (result (list)))
-    (cond ((null? stils)
-          (reverse! result))
-         ((not prev-stil)
-          (space-stil (car stils) (cdr stils) (list (car stils))))
-         (else
-          (let* ((stil (car stils))
-                 (dy (max (- baseline
-                             (+ (- (interval-bound (ly:stencil-extent prev-stil Y) DOWN))
-                                (interval-bound (ly:stencil-extent stil Y) UP)))
-                          0.0))
-                 (new-stil (ly:make-stencil
-                            (ly:stencil-expr stil)
-                            (ly:stencil-extent stil X)
-                            (cons (interval-bound (ly:stencil-extent stil Y) DOWN)
-                                  (+ (interval-bound (ly:stencil-extent stil Y) UP) dy)))))
-            (space-stil stil (cdr stils) (cons new-stil result)))))))
+    (if (null? stils)
+       (reverse! result)
+       (let* ((stil (car stils))
+              (dy-top (max (- (/ baseline 1.5)
+                              (interval-bound (ly:stencil-extent stil Y) UP))
+                           0.0))
+              (dy-bottom (max (+ (/ baseline 3.0)
+                                 (interval-bound (ly:stencil-extent stil Y) DOWN))
+                              0.0))
+              (new-stil (ly:make-stencil
+                         (ly:stencil-expr stil)
+                         (ly:stencil-extent stil X)
+                         (cons (- (interval-bound (ly:stencil-extent stil Y) DOWN)
+                                  dy-bottom)
+                               (+ (interval-bound (ly:stencil-extent stil Y) UP)
+                                  dy-top)))))
+         (space-stil (cdr stils) (cons new-stil result))))))
 
 (define-builtin-markup-list-command (justified-lines layout props args)
   (markup-list?)