On Fri, 2010-04-09 at 02:30 -0400, Boris Shingarov wrote: > What I am stuck on now, is the function > Align_interface::get_minimum_translations(). > Could you explain the high-level design of what this is doing?
The function builds a skyline for each staff/lyrics/etc, then compares the skylines to find the minimum amounts that each staff must be moved down so that no collisions occur. > In all cases in the book I am trying to typeset, everything appears > to work A-ok, but on the "hara-kiri-pianostaff" regtest, this now returns > an empty vector of offsets when called from > System::part_of_line_pure_height(), > but the corresponding vector of staves is non-empty, which causes > a segfault when trying to translate the 0th staff. get_skylines modifies its elems argument, removing all staves that are empty. If every staff is empty (which happens in hara-kiri-pianostaff, IIRC) then get_skylines doesn't return any skylines and hence get_minimum_translations (see align-interface.cc:226) returns an empty vector. I'm not actually sure why it does this (instead of returning, say, a vector of zeros) so if the regression tests pass, I'd be ok with changing this. Alternatively, you could just check explicitly for an empty result in System::part_of_line_pure_height. Cheers, Joe _______________________________________________ bug-lilypond mailing list bug-lilypond@gnu.org http://lists.gnu.org/mailman/listinfo/bug-lilypond