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.13.1-1~11^2~4^2~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=619c2c2587f5fcbfa8573023bee0a097e30bf70a;p=lilypond.git Fix fret diagram xo string offsets --- diff --git a/scm/fret-diagrams.scm b/scm/fret-diagrams.scm index a37c490aa9..992c94941a 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