]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fixes manual beaming over rests and vertical spacing problem (issue 3242)
authorMike Solomon <mike@apollinemike.com>
Sat, 23 Mar 2013 18:09:28 +0000 (19:09 +0100)
committerMike Solomon <mike@apollinemike.com>
Sat, 23 Mar 2013 18:09:28 +0000 (19:09 +0100)
lily/side-position-interface.cc
lily/stencil-integral.cc
scm/define-grobs.scm

index 095b8b49c344db5566303b987dd890eea42136a4..4d8efe1ced4d0687fe0aa61ddf46fc0d190b8b14 100644 (file)
@@ -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.
index 58b2ff46ca55277930db2657c1d920a67485de77..0f1f14ff50485e09ff3933cc6db261ec6a7ab17e 100644 (file)
@@ -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<Spanner *> (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")));
 }
 
index a65ff1782a8a1540ccd6ac837ead713345a4c5a0..19a767fba5cd980145fa33cd578053e3c606873b 100644 (file)
        (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)
        (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)
        (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)
        (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)
        (collapse-height . 5.0)
        (direction . ,LEFT)
        (font-encoding . fetaBraces)
+       (cross-staff . #t)
        (padding . 0.3)
        (stencil . ,ly:system-start-delimiter::print)
        (style . brace)
      . (
        (collapse-height . 5.0)
        (direction . ,LEFT)
+       (cross-staff . #t)
        (padding . 0.8)
        (stencil . ,ly:system-start-delimiter::print)
        (style . bracket)
     (SystemStartSquare
      . (
        (direction . ,LEFT)
+       (cross-staff . #t)
        (stencil . ,ly:system-start-delimiter::print)
        (style . line-bracket)
        (thickness . 1.0)