X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fsnippets%2Fcentering-markup-on-note-heads-automatically.ly;h=7e0caf90e1e73a28c4b41861e4d576536611e06a;hb=248b82c3b9dcecf96351ad5f22540325fa54ad88;hp=509534a91b52878a72145a66ae105ac0012138cf;hpb=6d871fc1788f72ad0b385deba91bcc459cb57eb9;p=lilypond.git diff --git a/Documentation/snippets/centering-markup-on-note-heads-automatically.ly b/Documentation/snippets/centering-markup-on-note-heads-automatically.ly index 509534a91b..7e0caf90e1 100644 --- a/Documentation/snippets/centering-markup-on-note-heads-automatically.ly +++ b/Documentation/snippets/centering-markup-on-note-heads-automatically.ly @@ -1,7 +1,7 @@ %% Do not edit this file; it is automatically %% generated from LSR http://lsr.dsi.unimi.it %% This file is in the public domain. -\version "2.13.4" +\version "2.13.10" \header { lsrtags = "text, tweaks-and-overrides" @@ -24,20 +24,15 @@ textScriptCenterOnNote = \override TextScript #'X-offset = #(lambda (grob) (let* ((paper-col (ly:grob-parent grob X)) (elts (ly:grob-object paper-col 'elements)) - (rhythmic-head - (if (ly:grob-array? elts) - (let loop ((array-idx 0)) - (call/cc - (lambda (return) - (let ((array-len (ly:grob-array-length elts))) - (if (< array-idx (1- array-len)) - (let ((elt (ly:grob-array-ref elts array-idx))) - (if (grob::has-interface elt - 'rhythmic-head-interface) - (return elt) - (loop (1+ array-idx))))) - grob)))) - grob))) + (rhythmic-head grob)) + + (for-each + (lambda (idx) + (let ((elt (ly:grob-array-ref elts idx))) + (if (grob::has-interface elt + 'rhythmic-grob-interface) + (set! rhythmic-head elt)))) + (reverse (iota (ly:grob-array-length elts)))) (+ (ly:self-alignment-interface::x-aligned-on-self grob)