From: Mike Solomon Date: Sat, 23 Mar 2013 18:09:28 +0000 (+0100) Subject: Fixes manual beaming over rests and vertical spacing problem (issue 3242) X-Git-Tag: release/2.17.15-1~17^2~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7b2cb93fc69c7d7c45f0ae6495f688752efeb107;p=lilypond.git Fixes manual beaming over rests and vertical spacing problem (issue 3242) --- diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 095b8b49c3..4d8efe1ced 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -324,13 +324,6 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i dim.set_minimum_height (0.0); } - // Ditto - seems kludgy, but this time logic of SystemStartBrackets - if (my_dim.is_empty ()) - { - my_dim = Skyline (my_dim.direction ()); - my_dim.set_minimum_height (isinf (max_raise) ? 0.0 : max_raise); - } - // 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. diff --git a/lily/stencil-integral.cc b/lily/stencil-integral.cc index 58b2ff46ca..0f1f14ff50 100644 --- a/lily/stencil-integral.cc +++ b/lily/stencil-integral.cc @@ -981,16 +981,6 @@ Grob::maybe_pure_internal_simple_skylines_from_extents (Grob *me, Axis a, bool p ? Interval (-infinity_f, infinity_f) : me->maybe_pure_extent (me, Y_AXIS, pure, beg, end); - // In horizontal spacing, there are grobs like SystemStartBracket - // that take up no vertical spcae. So, if the y extent is empty, - // we use the entire Y extent ot make the X a sort of horizontal wall. - // Ditto for vertical spacing and grobs like BassFigureAlginmentPositioning. - if (a == Y_AXIS && yex.is_empty ()) - yex.set_full (); - - if (a == X_AXIS && xex.is_empty ()) - xex.set_full (); - if (xex.is_empty () || yex.is_empty ()) return Skyline_pair ().smobbed_copy (); @@ -1005,6 +995,8 @@ Grob::pure_simple_vertical_skylines_from_extents (SCM smob, SCM begscm, SCM ends Grob *me = unsmob_grob (smob); int beg = robust_scm2int (begscm, 0); int end = robust_scm2int (endscm, INT_MAX); + // We cannot measure the width of a spanner before line breaking, + // so we assume that the width is infinite. return maybe_pure_internal_simple_skylines_from_extents (me, X_AXIS, true, beg, end, dynamic_cast (me), false); } @@ -1023,6 +1015,9 @@ Grob::pure_simple_horizontal_skylines_from_extents (SCM smob, SCM begscm, SCM en Grob *me = unsmob_grob (smob); int beg = robust_scm2int (begscm, 0); int end = robust_scm2int (endscm, INT_MAX); + // If the grob is cross staff, we cannot measure its Y-extent before + // wayyyy downstream (after spacing of axis groups is done). + // Thus, we assume that the Y extent is infinite for cross staff grobs. return maybe_pure_internal_simple_skylines_from_extents (me, Y_AXIS, true, beg, end, false, to_boolean (me->get_property ("cross-staff"))); } @@ -1031,6 +1026,7 @@ SCM Grob::simple_horizontal_skylines_from_extents (SCM smob) { Grob *me = unsmob_grob (smob); + // See comment in function above. return maybe_pure_internal_simple_skylines_from_extents (me, Y_AXIS, false, 0, 0, false, to_boolean (me->get_property ("cross-staff"))); } diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index a65ff1782a..19a767fba5 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -292,6 +292,7 @@ (padding . 0.2) (positioning-done . ,ly:align-interface::align-to-minimum-distances) (stacking-dir . ,DOWN) + (X-extent . ,ly:axis-group-interface::width) (Y-extent . ,axis-group-interface::height) (meta . ((class . Spanner) (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common) @@ -307,6 +308,7 @@ (padding . 0.5) (side-axis . ,Y) (staff-padding . 1.0) + (X-extent . ,ly:axis-group-interface::width) (Y-extent . ,axis-group-interface::height) (Y-offset . ,side-position-interface::y-aligned-side) (meta . ((class . Spanner) @@ -335,6 +337,7 @@ (adjacent-pure-heights . ,ly:axis-group-interface::adjacent-pure-heights) (axes . (,Y)) (vertical-skylines . ,ly:axis-group-interface::calc-skylines) + (X-extent . ,ly:axis-group-interface::width) (Y-extent . ,axis-group-interface::height) (meta . ((class . Spanner) (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common) @@ -2233,6 +2236,7 @@ (collapse-height . 5.0) (direction . ,LEFT) + (cross-staff . #t) ;; ugh--hardcoded. (padding . -0.1) ;; bar must cover rounded ending of staff line. (stencil . ,ly:system-start-delimiter::print) @@ -2249,6 +2253,7 @@ (collapse-height . 5.0) (direction . ,LEFT) (font-encoding . fetaBraces) + (cross-staff . #t) (padding . 0.3) (stencil . ,ly:system-start-delimiter::print) (style . brace) @@ -2263,6 +2268,7 @@ . ( (collapse-height . 5.0) (direction . ,LEFT) + (cross-staff . #t) (padding . 0.8) (stencil . ,ly:system-start-delimiter::print) (style . bracket) @@ -2277,6 +2283,7 @@ (SystemStartSquare . ( (direction . ,LEFT) + (cross-staff . #t) (stencil . ,ly:system-start-delimiter::print) (style . line-bracket) (thickness . 1.0)