]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix vertical alignment of FretBoards
authorCarl Sorensen <c_sorensen@byu.edu>
Sat, 7 Feb 2009 22:53:38 +0000 (15:53 -0700)
committerPatrick McCarty <pnorcks@gmail.com>
Fri, 17 Jul 2009 07:29:12 +0000 (00:29 -0700)
The origin of the fret diagram will be at fret zero, string 1.
The x alignment is adjusted to put the fret diagram over a note
for the fret diagram markup.  The y alignment used to be centered,
but now it is not adjusted during creation of the grob.

Add regression test for fret board alignment
(cherry picked from commit c9457c9c0556da32dac4f07e8cc8236656120eb4)

input/regression/fret-board-alignment.ly [new file with mode: 0644]
scm/fret-diagrams.scm

diff --git a/input/regression/fret-board-alignment.ly b/input/regression/fret-board-alignment.ly
new file mode 100644 (file)
index 0000000..cc347c0
--- /dev/null
@@ -0,0 +1,23 @@
+\header {
+
+  texidoc = "FretBoards should be aligned in the Y direction
+at the fret-zero, string 1 intersection."
+
+}
+
+\version "2.12.2"
+
+\include "predefined-guitar-fretboards.ly"
+
+mychords = \chordmode{
+  c1 f g
+}
+
+<<
+  \context ChordNames {
+    \mychords
+  }
+  \context FretBoards {
+    \mychords
+  }
+>>
index f18cf3e7d85f8d7d829eed312b5d2decc7d8b2c3..0bf9d6bda717f42ca4ca07c32c3679599836b516 100644 (file)
@@ -397,8 +397,7 @@ fret & string spacing by @var{size}. Orientation is given by @var{orientation}"
                    dot-pos orientation)
   "Draw a capo indicator across the full width of the fret-board
 at @var{fret}."
-(let* (;(sth (* th size))
-       (capo-thick
+(let* ((capo-thick
          (* size (assoc-get 'capo-thickness details 0.5)))
        (half-thick (* capo-thick 0.5))
        (last-string-pos 0)
@@ -789,9 +788,7 @@ Line thickness is given by @var{th}, fret & string spacing by
            fret-diagram-stencil
            (label-fret 
              layout props string-count fret-range size orientation))))
-    (ly:stencil-aligned-to
-      (ly:stencil-aligned-to fret-diagram-stencil X alignment)
-       Y 0)))
+      (ly:stencil-aligned-to fret-diagram-stencil X alignment)))
 
 (define (fret-parse-definition-string props definition-string)
  "Parse a fret diagram string and return a pair containing: