]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-lib.scm
Prevents dynamics from colliding with cross-staff stems.
[lilypond.git] / scm / output-lib.scm
index 9227787b8cb40d14ead03b817fdcd0d85e02c88f..9137d5be170845fd9e0d9cd498dc425c01575982 100644 (file)
@@ -58,7 +58,6 @@
 
     (ly:text-interface::interpret-markup layout props text)))
 
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; beam slope
 
@@ -406,21 +405,17 @@ and duration-log @var{log}."
     (coord-operation - from-neighbors height)))
 
 (define-public (pure-from-neighbor-interface::account-for-span-bar grob)
-  (define (other-op x) (x (cons cdr car)))
   (let* ((esh (pure-from-neighbor-interface::extra-spacing-height grob))
-         (hsb (ly:grob-property grob 'has-span-bar)))
+         (hsb (ly:grob-property grob 'has-span-bar))
+         (ii (interval-intersection esh (cons -1.01 1.01))))
     (if (pair? hsb)
-      (cons-map
-        (lambda (x)
-          (if (and ((other-op x) hsb)
-                   (not (and (eq? x car)
-                             (not (ly:grob-property grob 'allow-span-bar)))))
-              (x esh)
-              (x (cons -1.01 1.01))))
-        (cons car cdr))
-      '(-1.01 . 1.01))))
-
-(define (pure-from-neighbor-interface::extra-spacing-height-including-staff grob)
+        (cons (car (if (and (cdr hsb)
+                       (ly:grob-property grob 'allow-span-bar))
+                       esh ii))
+              (cdr (if (car hsb) esh ii)))
+        ii)))
+
+(define-public (pure-from-neighbor-interface::extra-spacing-height-including-staff grob)
   (let ((esh (pure-from-neighbor-interface::extra-spacing-height grob))
         (to-staff (coord-operation -
                                    (interval-widen