[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug: restarting staff destroys DynamicLineSpanner.staff-padding afte
Re: Bug: restarting staff destroys DynamicLineSpanner.staff-padding after line break
Thu, 07 Mar 2019 00:13:30 -0800
On 2019-03-06 4:55 pm, Trevor Bača wrote:
Restarting the staff during the lifespan of a multisystem
DynamicLineSpanner destroys the value of DynamicLineSpanner properties
(like staff-padding) that were set when the DynamicLineSpanner was
In the MWE below, the hairpin should exhibit staff-padding equal to 10
staff spaces below all four systems; but the value of staff-padding is
at the point (in system 2) that the staff is restarted; we see evidence
this after the next line break (in systems 3 and 4) where no staff
staff-padding is not destroyed. It is still set.
The issue is the broken spanners have lost their reference to the
StaffSymbol. And Side_position_interface::aligned_side
(side-position-interface.cc:180) expects that there is a valid
StaffSymbol in order to care about staff-padding.
Add the following \override to your code and note the output:
\override DynamicLineSpanner.after-line-breaking = #(lambda (grob)
(display (format "~a ~a ~a\n"
(ly:grob-property grob 'staff-padding)
(ly:grob-property grob 'Y-offset)
(ly:grob-object grob 'staff-symbol))))
Drawing systems...10 -12.05 #<Grob StaffSymbol >
10 -12.05 #<Grob StaffSymbol >
10 -4.57775475073964 #<undefined>
10 -5.45702919685039 #<undefined>
You can see that the staff-padding is still 10 for all of the spanners.
But only the first two that have a valid StaffSymbol end up with the
-- Aaron Hill