]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4686: Don't hardwire usable size of StrokeFinger.digit-names vector
authorDavid Kastrup <dak@gnu.org>
Tue, 8 Dec 2015 20:42:18 +0000 (21:42 +0100)
committerDavid Kastrup <dak@gnu.org>
Sun, 13 Dec 2015 11:36:15 +0000 (12:36 +0100)
scm/output-lib.scm

index 1dbf4ab7ae8c277cbf23c5fafafd5b1d05ebfcbd..dcec6ae939b162c26c7c0734de5b5095b852d81a 100644 (file)
@@ -1121,9 +1121,11 @@ If @var{data} is @code{#f} or @code{'()}, it is not included in the sum."
 (define-public (stroke-finger::calc-text grob)
   (let ((event (event-cause grob)))
     (or (ly:event-property event 'text #f)
-        (vector-ref (ly:grob-property grob 'digit-names)
-                    (1- (max 1
-                             (min 5 (ly:event-property event 'digit))))))))
+        (let ((digit-names (ly:grob-property grob 'digit-names)))
+          (vector-ref digit-names
+                      (1- (max 1
+                               (min (vector-length digit-names)
+                                    (ly:event-property event 'digit)))))))))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;