]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/fret-diagrams.scm
Merge branch 'lilypond/translation' of ssh://git.sv.gnu.org/srv/git/lilypond into...
[lilypond.git] / scm / fret-diagrams.scm
index 70390d23148ca24e4a08503e841235180d3fae59..d0883a48ac5ab4dccb3d33e24a8d6e273d85c392 100644 (file)
@@ -246,20 +246,20 @@ with magnification @var{mag} of the string @var{text}."
            (if (eq? finger-code 'in-dot) 0.425 0.25)) ; bigger dots if labeled
          (default-dot-position
            (if (eq? finger-code 'in-dot)
-             (- 0.95 default-dot-radius)
-             0.6)) ; move up to make room for bigger dot if labeled
+               (- 0.95 default-dot-radius)
+               0.6)) ; move up to make room for bigger dot if labeled
          (dot-radius
            (assoc-get
              'dot-radius details default-dot-radius))  ; needed for draw-dots
-         ; and draw-barre
+                                                       ; and draw-barre
          (dot-position
            (assoc-get
-             'dot-position details default-dot-position)) ; needed for draw-dots
-         ; and draw-barre
+             'dot-position details default-dot-position)) ; needed for 
+                                                    ; draw-dots and draw-barre
          (th
            (* (ly:output-def-lookup layout 'line-thickness)
               (chain-assoc-get 'thickness props 0.5))) ; needed for draw-frets
-         ; and draw-strings
+                                                       ; and draw-strings
          (sth (* size th))
          (thickness-factor (assoc-get 'string-thickness-factor details 0))
          (alignment
@@ -286,12 +286,26 @@ with magnification @var{mag} of the string @var{text}."
       in stencil coordinate system."
       (cond
         ((eq? orientation 'landscape)
-         (cons fret-coordinate string-coordinate))
+         (cons fret-coordinate
+               (- string-coordinate (1- string-count))))
         ((eq? orientation 'opposing-landscape)
          (cons (- fret-coordinate) (- string-coordinate)))
         (else
           (cons string-coordinate (- fret-coordinate)))))
 
+    (define (stencil-coordinate-offset fret-offset string-offset)
+      "Return a pair @code{(x-offset . y-offset)}
+      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
@@ -641,6 +655,7 @@ fret-diagram overall parameters."
          (if (null? restlist)
            positioned-glyph
            (ly:stencil-add
+             positioned-glyph
              (draw-xo restlist)))))
 
        (define (draw-capo fret)
@@ -733,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