lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Grob callback: query position (unbroken, end-of-line, start-of-line)


From: Klaus Blum
Subject: Re: Grob callback: query position (unbroken, end-of-line, start-of-line)
Date: Thu, 6 Apr 2017 06:18:52 -0700 (MST)

Hi Simon, 


Simon Albrecht-2 wrote
> I would like to override RehearsalMark’s self-alignment-X to -1 only if 
> it’s at start-of-line. How would I find that out in a grob callback?


I'm really no expert on this topic, but I once got some help from David
Nalesnik for snippet 1000:

\override HorizontalBracket.stencil =
$(lambda (grob)
   (let* (
           (open-on-left  (=  1 (ly:item-break-dir (ly:spanner-bound grob
LEFT ))))
           (open-on-right (= -1 (ly:item-break-dir (ly:spanner-bound grob
RIGHT))))
           )
     ; ...do some more stuff...
     ))

The NR tells about those to functions:

Function: ly:item-break-dir it
    The break status direction of item it. -1 means end of line, 0 unbroken,
and 1 beginning of line. 
        
Function: ly:spanner-bound spanner dir
    Get one of the bounds of spanner. dir is -1 for left, and 1 for right. 


Hope that helps.
Cheers, 
Klaus



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Grob-callback-query-position-unbroken-end-of-line-start-of-line-tp201994p201995.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]