]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/stencil.scm
* scm/stencil.scm (circle-stencil): don't center stencil argument,
[lilypond.git] / scm / stencil.scm
index e4befe50d3de28076c0f9333d381a0a29051da92..b2d425e6ead5c7061d7e327c0d08934b9a92dbe4 100644 (file)
@@ -2,7 +2,7 @@
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
-;;;; (c) 2003--2006 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;; (c) 2003--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
 (define-public (stack-stencils axis dir padding stils)
   "Stack stencils STILS in direction AXIS, DIR, using PADDING."
@@ -100,9 +100,16 @@ encloses the contents.
         (y-ext (ly:stencil-extent stencil 1))
         (diameter (max (- (cdr x-ext) (car x-ext))
                        (- (cdr y-ext) (car y-ext))))
-        (radius (+ (/ diameter 2) padding thickness)))
+        (radius (+ (/ diameter 2) padding thickness))
+        (circle (make-circle-stencil radius thickness #f)))
+
     (ly:stencil-add
-     (centered-stencil stencil) (make-circle-stencil radius thickness #f))))
+     stencil
+     (ly:stencil-translate circle
+                          (cons
+                           (interval-center x-ext)
+                           (interval-center y-ext))))))
+
 
 (define-public (fontify-text font-metric text)
   "Set TEXT with font FONT-METRIC, returning a stencil."
@@ -310,14 +317,6 @@ grestore
              rest))
        expr))
   
-  (define (music-cause grob)
-    (let*
-       ((cause (ly:grob-property  grob 'cause)))
-      
-      (cond
-       ((ly:music? cause) cause)
-       ((ly:grob? cause) (music-cause cause))
-       (else #f))))
 
   (define (pythonic-string expr)
     "escape quotes and slashes for python consumption"
@@ -341,8 +340,8 @@ grestore
        ((grob (car expr))
         (rest (cdr expr))
         (collected '())
-        (cause (music-cause grob))
-        (input (if (ly:music? cause) (ly:music-property cause 'origin) #f))
+        (cause (event-cause grob))
+        (input (if (ly:stream-event? cause) (ly:event-property cause 'origin) #f))
         (location (if (ly:input-location? input) (ly:input-file-line-char-column input) '()))
 
         (x-ext (ly:grob-extent grob system-grob X))