From: Carl Sorensen Date: Sat, 7 Feb 2009 22:53:38 +0000 (-0700) Subject: Fix vertical alignment of FretBoards X-Git-Tag: release/2.12.3-1~152 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=c0a7f56e2f0dfa32bd7f6fadaf43c5917c692d93;p=lilypond.git Fix vertical alignment of FretBoards 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) --- diff --git a/input/regression/fret-board-alignment.ly b/input/regression/fret-board-alignment.ly new file mode 100644 index 0000000000..cc347c098b --- /dev/null +++ b/input/regression/fret-board-alignment.ly @@ -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 + } +>> diff --git a/scm/fret-diagrams.scm b/scm/fret-diagrams.scm index f18cf3e7d8..0bf9d6bda7 100644 --- a/scm/fret-diagrams.scm +++ b/scm/fret-diagrams.scm @@ -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: