--- /dev/null
+\version "2.17.18"
+
+\header {
+ texidoc = "An empty Dynamics context does not confuse the spacing."
+}
+
+\score {
+ \new PianoStaff <<
+ \new Dynamics { s1}
+ \new Dynamics { s2\f\> s4 s\!\p }
+ \new Staff {d'2 g''}
+ \new Dynamics { s1 }
+ \new Dynamics { s2\f\> s4 s\!\p }
+ \new Dynamics { s1 }
+ \new Staff {d'2 g''}
+ \new Dynamics { s1 }
+ \new Dynamics { s2\sustainOn s4 s\sustainOff }
+ >>
+ \layout {
+ \context {
+ \Dynamics
+ \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing
+ = #'((minimum-distance . 5))
+ }
+ }
+}
}
else // ! is_spaceable
{
+ if (staff->extent (staff, Y_AXIS).is_empty ())
+ continue;
+
if (loose_lines.empty ())
loose_lines.push_back (last_spaceable_line);