From: Joe Neeman Date: Mon, 30 Apr 2007 23:09:17 +0000 (+1000) Subject: Calculate bar-line break-visibility correctly instead of having X-Git-Tag: release/2.11.23-1~1^2~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d9c672a20f1a449825e12a8c0a4525a02409403a;p=lilypond.git Calculate bar-line break-visibility correctly instead of having a suicide in bar-line::calc-glyph-name. --- diff --git a/input/regression/break-alignment-anchor-alignment.ly b/input/regression/break-alignment-anchor-alignment.ly index 56d3f387b4..980a1b4622 100644 --- a/input/regression/break-alignment-anchor-alignment.ly +++ b/input/regression/break-alignment-anchor-alignment.ly @@ -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 diff --git a/input/regression/break-alignment-anchors.ly b/input/regression/break-alignment-anchors.ly index 4b32619e97..ae62412baa 100644 --- a/input/regression/break-alignment-anchors.ly +++ b/input/regression/break-alignment-anchors.ly @@ -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 diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 15d59483a8..5ae742fc8b 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -175,7 +175,7 @@ (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) diff --git a/scm/output-lib.scm b/scm/output-lib.scm index eea7614376..bd3aa52744 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -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."