]> git.donarmstrong.com Git - lilypond.git/commitdiff
Calculate bar-line break-visibility correctly instead of having
authorJoe Neeman <joeneeman@gmail.com>
Mon, 30 Apr 2007 23:09:17 +0000 (09:09 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Mon, 30 Apr 2007 23:09:17 +0000 (09:09 +1000)
a suicide in bar-line::calc-glyph-name.

input/regression/break-alignment-anchor-alignment.ly
input/regression/break-alignment-anchors.ly
scm/define-grobs.scm
scm/output-lib.scm

index 56d3f387b4e0988dbbf3ffad6a5831f98a0f649b..980a1b46228faf326b6fc4ab0399b81caab111bf 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.11.23"
+\version "2.11.22"
 
 \header {
   texidoc = "The default callback for break-align-anchor in clefs and time/key
index 4b32619e9739e892049f87c48f5348cb575f078b..ae62412baa2a189cc506e3ea64e88196b33cee96 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.11.23"
+\version "2.11.22"
 
 \header {
   texidoc = "The break-align-anchor property of a break-aligned grob gives
index 15d59483a8ffc9ead9c561241c01d4061544fb79..5ae742fc8b43b747f5007d4594fde0f2ba166597 100644 (file)
        (glyph . "|")
        (gap . 0.4)
        (layer . 0)
-       (break-visibility . ,all-visible)
+       (break-visibility . ,bar-line::calc-break-visibility)
        (non-musical . #t)
        (stencil . ,ly:bar-line::print)
        (glyph-name . ,bar-line::calc-glyph-name)
index eea76143769952258f68b3dd449f889a1d20b7f1..bd3aa52744aea695cfce8e72ce91341f3683a5ea 100644 (file)
@@ -224,45 +224,49 @@ centered, X==1 is at the right, X == -1 is at the left."
 
 ;;
 ;; How should a  bar line behave at a break? 
-;;
-;; Why prepend `default-' to every scm identifier?
+(define bar-glyph-alist
+  '((":|:" . (":|" . "|:"))
+    ("||:" . ("||" . "|:"))
+    ("dashed" . ("dashed" . '())) 
+    ("|" . ("|" . ()))
+    ("||:" . ("||" . "|:"))
+    ("|s" . (() . "|"))
+    ("|:" . ("|" . "|:"))
+    ("|." . ("|." . ()))
+    
+    ;; hmm... should we end with a bar line here?
+    (".|" . ("|" . ".|"))
+    (":|" . (":|" . ()))
+    ("||" . ("||" . ()))
+    (".|." . (".|." . ()))
+    ("" . ("" . ""))
+    (":" . (":" . ""))
+    ("." . ("." . ()))
+    ("empty" . (() . ()))
+    ("brace" . (() . "brace"))
+    ("bracket" . (() . "bracket")) 
+    ))
+
 (define-public (bar-line::calc-glyph-name grob)
   (let* (
         (glyph (ly:grob-property grob 'glyph))
         (dir (ly:item-break-dir grob))
-        (result (assoc glyph 
-                      '((":|:" . (":|" . "|:"))
-                        ("||:" . ("||" . "|:"))
-                        ("dashed" . ("dashed" . '())) 
-                        ("|" . ("|" . ()))
-                        ("||:" . ("||" . "|:"))
-                        ("|s" . (() . "|"))
-                        ("|:" . ("|" . "|:"))
-                        ("|." . ("|." . ()))
-
-                        ;; hmm... should we end with a bar line here?
-                        (".|" . ("|" . ".|"))
-                        (":|" . (":|" . ()))
-                        ("||" . ("||" . ()))
-                        (".|." . (".|." . ()))
-                        ("" . ("" . ""))
-                        (":" . (":" . ""))
-                        ("." . ("." . ()))
-                        ("empty" . (() . ()))
-                        ("brace" . (() . "brace"))
-                        ("bracket" . (() . "bracket"))  )))
+        (result (assoc glyph  bar-glyph-alist))
         (glyph-name (if (= dir CENTER)
                         glyph
                         (if (and result (string? (index-cell (cdr result) dir)))
                             (index-cell (cdr result) dir)
                             #f)))
         )
-
-    (if (not glyph-name)
-       (ly:grob-suicide! grob))
-
     glyph-name))
 
+(define-public (bar-line::calc-break-visibility grob)
+  (let* ((glyph (ly:grob-property grob 'glyph))
+        (result (assoc glyph bar-glyph-alist)))
+    (if result
+       (vector (string? (cadr result)) #t (string? (cddr result)))
+       #(#f #f #f))))
+
 
 (define-public (shift-right-at-line-begin g)
   "Shift an item to the right, but only at the start of the line."