X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fside-position-interface.cc;h=026a3286c55e9fae2c8d275aa5fb089dc1072c34;hb=9dd88ce33b9caf1ff6746c92f3b5080727dde946;hp=5a8ecb74c91b8eac59f6489995b63daecfee2d80;hpb=6e4e69f2735a764eab2e6f70f83546461da0203b;p=lilypond.git diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 5a8ecb74c9..026a3286c5 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -314,6 +314,27 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i dim.set_minimum_height (staff_extents[dir]); } + // Sometimes, we want to side position for grobs but they + // don't position against anything. Some cases where this is true: + // - StanzaNumber if the supporting lyrics are hara-kiri'd + // SystemStartBracket + // InstrumentName + // In all these cases, we set the height of the support to 0. + // This becomes then like the self-alignment-interface with the + // caveat that there is padding added. + // TODO: if there is a grob that never has side-support-elements + // (like InstrumentName), why are we using this function? Isn't it + // overkill? A function like self-alignment-interface with padding + // works just fine. + // One could even imagine the two interfaces merged, as the only + // difference is that in self-alignment-interface we align on the parent + // where as here we align on a group of grobs. + if (dim.is_empty ()) + { + dim = Skyline (dim.direction ()); + dim.set_minimum_height (0.0); + } + // Many cross-staff grobs do not have good height estimations. // We give the grob the best chance of not colliding by shifting // it to the maximum height in the case of cross-staff alignment.