From: Carl Sorensen Date: Thu, 14 May 2009 11:58:19 +0000 (-0600) Subject: Fix fret diagram xo string offsets X-Git-Tag: release/2.12.3-1~14 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=207dd9350ecbcea14ebc5d45dadf45076ffc557f;p=lilypond.git Fix fret diagram xo string offsets (cherry picked from commit 829b576a30e1f53859a079a5be76c71a0fd901b6) --- diff --git a/scm/fret-diagrams.scm b/scm/fret-diagrams.scm index ce627b50fe..cb7ee6dbaa 100644 --- a/scm/fret-diagrams.scm +++ b/scm/fret-diagrams.scm @@ -293,6 +293,19 @@ with magnification @var{mag} of the string @var{text}." (else (cons string-coordinate (- fret-coordinate))))) + (define (stencil-coordinate-offset fret-offset string-offset) + "Return a pair @code{(x-offset . y-offstet)} + for translation in stencil coordinate system." + (cond + ((eq? orientation 'landscape) + (cons fret-offset (- string-offset))) + ((eq? orientation 'opposing-landscape) + (cons (- fret-offset) string-offset)) + (else + (cons string-offset (- fret-offset))))) + + + (define (make-bezier-sandwich-list start stop base height half-thickness) "Make the argument list for a bezier sandwich from @@ -642,6 +655,7 @@ fret-diagram overall parameters." (if (null? restlist) positioned-glyph (ly:stencil-add + positioned-glyph (draw-xo restlist))))) (define (draw-capo fret) @@ -734,18 +748,19 @@ at @var{fret}." (xo-stencil (draw-xo xo-list)) (xo-fret-offset (stencil-fretboard-offset - xo-stencil 'fret orientation))) + xo-stencil 'fret orientation)) + (xo-stencil-offset + (stencil-coordinate-offset + (- diagram-fret-top + xo-fret-offset + (* size xo-padding)) + 0))) (set! fret-diagram-stencil (ly:stencil-add fret-diagram-stencil (ly:stencil-translate xo-stencil - (stencil-coordinates - (- diagram-fret-top - xo-fret-offset - (* size xo-padding)) - 0)))))) ; no string offset - + xo-stencil-offset))))) (if (> capo-fret 0) (set! fret-diagram-stencil (ly:stencil-add