From: Joe Neeman Date: Sun, 21 Jan 2007 12:04:13 +0000 (+0200) Subject: Enable one-pass stretching for PianoStaff X-Git-Tag: release/2.11.15-1~9^2~10 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8eafccec8c45891d8e00366ca2f67f67a9c93cf9;p=lilypond.git Enable one-pass stretching for PianoStaff --- diff --git a/input/test/music-box.ly b/input/test/music-box.ly index 9e5b09cdb8..ae4567dbf7 100644 --- a/input/test/music-box.ly +++ b/input/test/music-box.ly @@ -126,10 +126,6 @@ prelude = >> \layout { - \context { - \PianoStaff - \override VerticalAlignment #'forced-distance = #10 - } line-width = 18.0 \cm } diff --git a/input/typography-demo.ly b/input/typography-demo.ly index 0ea37e871d..9182285cf1 100644 --- a/input/typography-demo.ly +++ b/input/typography-demo.ly @@ -157,10 +157,6 @@ pianoLH = \relative c'' \repeat volta 2\new Voice { \override Stem #'stemlet-length = #0.5 \override Slur #'height-limit = #1.5 } - \context { - \PianoStaff - \override VerticalAlignment #'forced-distance = #10 - } } \midi { diff --git a/lily/align-interface.cc b/lily/align-interface.cc index e52e8f69ff..69fb5e921c 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -33,17 +33,13 @@ Align_interface::calc_positioning_done (SCM smob) SCM axis = scm_car (me->get_property ("axes")); Axis ax = Axis (scm_to_int (axis)); - SCM force = me->get_property ("forced-distance"); - if (scm_is_number (force)) - Align_interface::align_to_fixed_distance (me, ax); - else - Align_interface::align_elements_to_extents (me, ax); + Align_interface::align_elements_to_extents (me, ax); return SCM_BOOL_T; } /* - merge with align-to-extents? + TODO: This belongs to the old two-pass spacing. Delete me. */ MAKE_SCHEME_CALLBACK(Align_interface, stretch_after_break, 1) SCM @@ -80,55 +76,6 @@ Align_interface::stretch_after_break (SCM grob) return SCM_UNSPECIFIED; } -/* - merge with align-to-extents? -*/ -void -Align_interface::align_to_fixed_distance (Grob *me, Axis a) -{ - Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"), - DOWN); - - Real dy = robust_scm2double (me->get_property ("forced-distance"), 0.0); - - extract_grob_set (me, "elements", elem_source); - - vector elems (elem_source); // writable.. - - Real where = 0; - - Interval v; - v.set_empty (); - vector translates; - - for (vsize j = elems.size (); j--;) - { - /* - This is not very elegant, in that we need special support for - hara-kiri. Unfortunately, the generic wiring of - force_hara_kiri_callback () (extent and offset callback) is - such that we might get into a loop if we call extent () or - offset () the elements. - */ - if (a == Y_AXIS - && Hara_kiri_group_spanner::has_interface (elems[j])) - Hara_kiri_group_spanner::consider_suicide (elems[j]); - - if (!elems[j]->is_live ()) - elems.erase (elems.begin () + j); - } - - for (vsize j = 0; j < elems.size (); j++) - { - where += stacking_dir * dy; - translates.push_back (where); - v.unite (Interval (where, where)); - } - - for (vsize i = 0; i < translates.size (); i++) - elems[i]->translate_axis (translates[i] - v.center (), a); -} - /* for each grob, find its upper and lower skylines. If the grob has an empty extent, delete it from the list instead. If the extent is non-empty but there is no skyline available (or pure is true), just @@ -165,52 +112,54 @@ get_skylines (Grob *me, for (vsize i = elements->size (); i--;) { Grob *g = (*elements)[i]; - Interval extent = g->maybe_pure_extent (g, a, pure, start, end); - Interval other_extent = pure ? Interval (-infinity_f, infinity_f) - : g->extent (common_refpoint, other_axis (a)); - Box b; - b[a] = extent; - b[other_axis (a)] = other_extent; - - if (extent.is_empty ()) - { - elements->erase (elements->begin () + i); - continue; - } - Skyline_pair skylines; - if (!pure - && Skyline_pair::unsmob (g->get_property ("skylines"))) - skylines = *Skyline_pair::unsmob (g->get_property ("skylines")); - else - { - if (!pure) - programming_error ("no skylines for alignment-child\n"); - - skylines = Skyline_pair (b, 0, other_axis (a)); - } /* each skyline is calculated relative to (potentially) a different other_axis coordinate. In order to compare the skylines effectively, we need to shift them to some absolute reference point */ if (!pure) { + Skyline_pair *skys = Skyline_pair::unsmob (g->get_property ("skylines")); + if (skys) + skylines = *skys; + else + programming_error ("no skylines for alignment-child\n"); + /* this is perhaps an abuse of minimum-?-extent: maybe we should create another property? But it seems that the only (current) use of minimum-Y-extent is to separate vertically-aligned elements */ SCM min_extent = g->get_property (a == X_AXIS ? "minimum-X-extent" : "minimum-Y-extent"); + if (is_number_pair (min_extent)) { + Box b; + Interval other_extent = g->extent (common_refpoint, other_axis (a)); b[a] = ly_scm2interval (min_extent); - skylines.insert (b, 0, other_axis (a)); + b[other_axis (a)] = other_extent; + if (!other_extent.is_empty ()) + skylines.insert (b, 0, other_axis (a)); } Real offset = child_refpoints[i]->relative_coordinate (common_refpoint, other_axis (a)); skylines.shift (offset); } + else + { + assert (a == Y_AXIS); + Interval extent = g->pure_height (g, start, end); + if (!extent.is_empty ()) + { + Box b; + b[a] = extent; + b[other_axis (a)] = Interval (-infinity_f, infinity_f); + skylines.insert (b, 0, other_axis (a)); + } + } - - ret->push_back (skylines); + if (skylines.is_empty ()) + elements->erase (elements->begin () + i); + else + ret->push_back (skylines); } reverse (*ret); } @@ -247,6 +196,7 @@ Align_interface::get_extents_aligned_translates (Grob *me, get_skylines (me, &elems, a, pure, start, end, &skylines); Real where = 0; + /* TODO: extra-space stuff belongs to two-pass spacing. Delete me */ SCM extra_space_handle = scm_assq (ly_symbol2scm ("alignment-extra-space"), line_break_details); Real extra_space = robust_scm2double (scm_is_pair (extra_space_handle) ? scm_cdr (extra_space_handle) @@ -313,16 +263,14 @@ void Align_interface::stretch (Grob *me, Real amount, Axis a) { extract_grob_set (me, "elements", elts); - Real non_empty_elts = 0.0; - for (vsize i = 0; i < elts.size (); i++) - non_empty_elts += !elts[i]->extent (me, a).is_empty (); - + Real non_empty_elts = stretchable_children_count (me); Real offset = 0.0; Direction dir = robust_scm2dir (me->get_property ("stacking-dir"), DOWN); for (vsize i = 0; i < elts.size (); i++) { elts[i]->translate_axis (dir * offset, a); - if (!elts[i]->extent (me, a).is_empty ()) + if (!elts[i]->extent (me, a).is_empty () + && !to_boolean (elts[i]->get_property ("keep-fixed-while-stretching"))) offset += amount / non_empty_elts; } me->flush_extent_cache (Y_AXIS); @@ -397,6 +345,21 @@ Align_interface::set_ordered (Grob *me) ga->set_ordered (true); } +int +Align_interface::stretchable_children_count (Grob const *me) +{ + extract_grob_set (me, "elements", elts); + int ret = 0; + + /* start at 1: we will never move the first child while stretching */ + for (vsize i = 1; i < elts.size (); i++) + if (!to_boolean (elts[i]->get_property ("keep-fixed-while-stretching")) + && !elts[i]->extent (elts[i], Y_AXIS).is_empty ()) + ret++; + + return ret; +} + MAKE_SCHEME_CALLBACK (Align_interface, calc_max_stretch, 1) SCM Align_interface::calc_max_stretch (SCM smob) @@ -405,7 +368,7 @@ Align_interface::calc_max_stretch (SCM smob) Spanner *spanner_me = dynamic_cast (me); Real ret = 0; - if (spanner_me) + if (spanner_me && stretchable_children_count (me) > 0) { Paper_column *left = dynamic_cast (spanner_me->get_bound (LEFT)); Real height = me->extent (me, Y_AXIS).length (); @@ -426,18 +389,15 @@ Align_interface::calc_max_stretch (SCM smob) Find Y-axis parent of G that has a #'forced-distance property. This has the effect of finding the piano-staff given an object in that piano staff. + + FIXME: piano staves no longer have forced-distance. The code that + relies on this function (in line-spanner) is broken. */ Grob * find_fixed_alignment_parent (Grob *g) { - while (g) - { - if (scm_is_number (g->get_property ("forced-distance"))) - return g; - - g = g->get_parent (Y_AXIS); - } - + (void) g; + programming_error ("deprecated. We don't use forced-distance anymore"); return 0; } @@ -457,7 +417,6 @@ ADD_INTERFACE (Align_interface, "align-dir " "axes " "elements " - "forced-distance " "padding " "positioning-done " "stacking-dir " diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index e87a108e7a..8c3ca97607 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -61,9 +61,12 @@ Axis_group_interface::relative_group_extent (vector const &elts, for (vsize i = 0; i < elts.size (); i++) { Grob *se = elts[i]; - Interval dims = se->extent (common, a); - if (!dims.is_empty ()) - r.unite (dims); + if (!to_boolean (se->get_property ("cross-staff"))) + { + Interval dims = se->extent (common, a); + if (!dims.is_empty ()) + r.unite (dims); + } } return r; } @@ -355,6 +358,12 @@ staff_priority_less (Grob * const &g1, Grob * const &g2) else if (priority_1 > priority_2) return false; + /* if neither grob has an outside-staff priority, the ordering will have no + effect -- we just need to choose a consistent ordering. We do this to + avoid the side-effect of calculating extents. */ + if (isinf (priority_1)) + return g1 < g2; + /* if there is no preference in staff priority, choose the left-most one */ Grob *common = g1->common_refpoint (g2, X_AXIS); Real start_1 = g1->extent (common, X_AXIS)[LEFT]; @@ -371,7 +380,8 @@ add_boxes (Grob *me, Grob *x_common, Grob *y_common, vector *const boxes) for (vsize i = 0; i < elements->size (); i++) add_boxes (elements->grob (i), x_common, y_common, boxes); } - else if (!scm_is_number (me->get_property ("outside-staff-priority"))) + else if (!scm_is_number (me->get_property ("outside-staff-priority")) + && !to_boolean (me->get_property ("cross-staff"))) boxes->push_back (Box (me->extent (x_common, X_AXIS), me->extent (y_common, Y_AXIS))); } @@ -510,6 +520,7 @@ ADD_INTERFACE (Axis_group_interface, "Y-common " "axes " "elements " + "keep-fixed-while-stretching " "max-stretch " "pure-Y-common " "pure-relevant-elements " diff --git a/lily/beam.cc b/lily/beam.cc index ecc9d0b5a6..75f859ffe4 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -695,7 +695,7 @@ Beam::consider_auto_knees (Grob *me) sets stem directions, a constant shift does not have an influence. */ - head_extents += stem->relative_coordinate (common, Y_AXIS); + head_extents += stem->pure_relative_y_coordinate (common, 0, INT_MAX); if (to_dir (stem->get_property_data ("direction"))) { @@ -974,7 +974,6 @@ Beam::shift_region_to_valid (SCM grob, SCM posns) Real dx = lvs->relative_coordinate (commonx, X_AXIS) - x0; Drul_array pos = ly_scm2interval (posns); - scale_drul (&pos, Staff_symbol_referencer::staff_space (me)); @@ -1421,6 +1420,24 @@ Beam::is_knee (Grob *me) return knee; } +bool +Beam::is_cross_staff (Grob *me) +{ + extract_grob_set (me, "stems", stems); + Grob *staff_symbol = Staff_symbol_referencer::get_staff_symbol (me); + for (vsize i = 0; i < stems.size (); i++) + if (Staff_symbol_referencer::get_staff_symbol (stems[i]) != staff_symbol) + return true; + return false; +} + +MAKE_SCHEME_CALLBACK (Beam, cross_staff, 1) +SCM +Beam::cross_staff (SCM smob) +{ + return scm_from_bool (is_cross_staff (unsmob_grob (smob))); +} + int Beam::get_direction_beam_count (Grob *me, Direction d) { diff --git a/lily/grob.cc b/lily/grob.cc index 01b2c7f3e3..c5f04d052f 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -613,6 +613,7 @@ ADD_INTERFACE (Grob, "before-line-breaking " "cause " "color " + "cross-staff " "extra-X-extent " "extra-Y-extent " "extra-offset " diff --git a/lily/include/align-interface.hh b/lily/include/align-interface.hh index 0d0f095846..8b0e9d9419 100644 --- a/lily/include/align-interface.hh +++ b/lily/include/align-interface.hh @@ -19,11 +19,11 @@ struct Align_interface DECLARE_SCHEME_CALLBACK (stretch_after_break, (SCM element)); DECLARE_SCHEME_CALLBACK (calc_max_stretch, (SCM)); static void stretch (Grob *, Real amount, Axis a); - static void align_to_fixed_distance (Grob *, Axis a); static void align_elements_to_extents (Grob *, Axis a); static vector get_extents_aligned_translates (Grob *, vector const&, Axis a, bool safe, int start, int end); + static int stretchable_children_count (Grob const*); static void set_ordered (Grob *); static Axis axis (Grob *); static void add_element (Grob *, Grob *); diff --git a/lily/include/beam.hh b/lily/include/beam.hh index 412540b076..e505cd6709 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -74,6 +74,7 @@ public: static Grob *last_normal_stem (Grob *); DECLARE_GROB_INTERFACE(); static void add_stem (Grob *, Grob *); + static bool is_cross_staff (Grob *); static bool is_knee (Grob *); static void set_beaming (Grob *, Beaming_pattern const *); static void set_stemlens (Grob *); @@ -93,6 +94,7 @@ public: DECLARE_SCHEME_CALLBACK (calc_normal_stems, (SCM)); DECLARE_SCHEME_CALLBACK (calc_concaveness, (SCM)); DECLARE_SCHEME_CALLBACK (set_stem_lengths, (SCM)); + DECLARE_SCHEME_CALLBACK (cross_staff, (SCM)); /* position callbacks */ DECLARE_SCHEME_CALLBACK (shift_region_to_valid, (SCM, SCM)); diff --git a/lily/include/grob.hh b/lily/include/grob.hh index c66c58f2dd..5876d4497d 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -80,6 +80,7 @@ public: SCM get_property_alist_chain (SCM) const; SCM internal_get_property (SCM symbol) const; SCM internal_get_property_data (SCM symbol) const; + SCM internal_get_non_callback_marker_property_data (SCM symbol) const; SCM internal_get_object (SCM symbol) const; void internal_set_object (SCM sym, SCM val); void internal_del_property (SCM symbol); diff --git a/lily/include/skyline.hh b/lily/include/skyline.hh index a4ea033fdb..bccac37238 100644 --- a/lily/include/skyline.hh +++ b/lily/include/skyline.hh @@ -72,6 +72,7 @@ public: Real height (Real airplane) const; Real max_height () const; void set_minimum_height (Real height); + bool is_empty () const; }; class Skyline_pair @@ -90,6 +91,7 @@ public: void merge (Skyline_pair const &other); Skyline &operator [] (Direction d); Skyline const &operator [] (Direction d) const; + bool is_empty () const; }; #endif /* SKYLINE_HH */ diff --git a/lily/include/slur.hh b/lily/include/slur.hh index 20fb7030ce..a5ea54e77e 100644 --- a/lily/include/slur.hh +++ b/lily/include/slur.hh @@ -27,6 +27,7 @@ public: DECLARE_SCHEME_CALLBACK (height, (SCM)); DECLARE_SCHEME_CALLBACK (outside_slur_callback, (SCM, SCM)); DECLARE_SCHEME_CALLBACK (pure_outside_slur_callback, (SCM, SCM, SCM, SCM)); + DECLARE_SCHEME_CALLBACK (cross_staff, (SCM)); DECLARE_GROB_INTERFACE(); static Bezier get_curve (Grob *me); }; diff --git a/lily/include/stem.hh b/lily/include/stem.hh index d022175a7c..c9b509ce7d 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -34,6 +34,7 @@ public: static int head_count (Grob *); static bool is_invisible (Grob *); static bool is_normal_stem (Grob *); + static bool is_cross_staff (Grob *); static Interval head_positions (Grob *); static Real stem_end_position (Grob *); static Stencil flag (Grob *); @@ -53,5 +54,6 @@ public: DECLARE_SCHEME_CALLBACK (width, (SCM smob)); DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM)); DECLARE_SCHEME_CALLBACK (height, (SCM)); + DECLARE_SCHEME_CALLBACK (cross_staff, (SCM)); }; #endif diff --git a/lily/skyline.cc b/lily/skyline.cc index b729e5312b..5eedbe2537 100644 --- a/lily/skyline.cc +++ b/lily/skyline.cc @@ -582,6 +582,12 @@ Skyline::to_points () const return out; } +bool +Skyline::is_empty () const +{ + return buildings_.empty (); +} + Skyline_pair::Skyline_pair () : skylines_ (Skyline (DOWN), Skyline (UP)) { @@ -625,6 +631,13 @@ Skyline_pair::merge (Skyline_pair const &other) skylines_[DOWN].merge (other[DOWN]); } +bool +Skyline_pair::is_empty () const +{ + return skylines_[UP].is_empty () + && skylines_[DOWN].is_empty (); +} + Skyline& Skyline_pair::operator [] (Direction d) { diff --git a/lily/slur.cc b/lily/slur.cc index 1f9e605fb9..f3938b23d1 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -356,6 +356,20 @@ Slur::auxiliary_acknowledge_extra_object (Grob_info const &info, e->warning ("Ignoring grob for slur. avoid-slur not set?"); } +MAKE_SCHEME_CALLBACK (Slur, cross_staff, 1) +SCM +Slur::cross_staff (SCM smob) +{ + Grob *me = unsmob_grob (smob); + Grob *staff = Staff_symbol_referencer::get_staff_symbol (me); + assert (staff); // delete me + extract_grob_set (me, "note-columns", cols); + + for (vsize i = 0; i < cols.size (); i++) + if (Staff_symbol_referencer::get_staff_symbol (cols[i]) != staff) + return SCM_BOOL_T; + return SCM_BOOL_F; +} ADD_INTERFACE (Slur, diff --git a/lily/stem.cc b/lily/stem.cc index 7c369e4bb0..dd247b4baa 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -239,6 +239,10 @@ Stem::pure_height (SCM smob, SCM start, SCM end) if (!is_normal_stem (me)) return ly_interval2scm (iv); + + /* if we are part of a cross-staff beam, return empty */ + if (get_beam (me) && Beam::is_cross_staff (get_beam (me))) + return ly_interval2scm (iv); Real ss = Staff_symbol_referencer::staff_space (me); Real len = scm_to_double (calc_length (smob)) * ss / 2; @@ -997,6 +1001,20 @@ Stem::beam_multiplicity (Grob *stem) return le; } +bool +Stem::is_cross_staff (Grob *stem) +{ + Grob *beam = unsmob_grob (stem->get_object ("beam")); + return beam && Beam::is_cross_staff (beam); +} + +MAKE_SCHEME_CALLBACK (Stem, cross_staff, 1) +SCM +Stem::cross_staff (SCM smob) +{ + return scm_from_bool (is_cross_staff (unsmob_grob (smob))); +} + /* FIXME: Too many properties */ ADD_INTERFACE (Stem, "The stem represent the graphical stem. " diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index ea7d9c5db0..9ac5a25294 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -307,11 +307,7 @@ contained staves are not connected vertically." \description "Just like @code{GrandStaff} but with a forced distance between the staves, so cross staff beaming and slurring can be used." - - \override VerticalAlignment #'forced-distance = #12 - \override VerticalAlignment #'self-alignment-Y = #0 - \consists "Vertical_align_engraver" \consists "Instrument_name_engraver" instrumentName = #'() @@ -380,6 +376,7 @@ printing of a single line of lyrics. " \override VerticalAxisGroup #'remove-first = ##t \override VerticalAxisGroup #'remove-empty = ##t + \override VerticalAxisGroup #'keep-fixed-while-stretching = ##t \override SeparationItem #'padding = #0.2 \override InstrumentName #'self-alignment-Y = ##f diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index bddef11f2c..41e74c2078 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -169,8 +169,6 @@ include @code{medium}, @code{bold}, @code{bold-narrow}, etc.") (font-shape ,symbol? "Select the shape of a font. Choices include @code{upright}, @code{italic}, @code{caps}.") (forced ,boolean? "manually forced accidental") - (forced-distance ,ly:dimension? "A fixed distance between object -reference points in an alignment.") (force-hshift ,number? "This specifies a manual shift for notes in collisions. The unit is the note head width of the first voice note. This is used by @internalsref{note-collision-interface}.") @@ -210,6 +208,7 @@ set beam/slur quant to this position, and print the respective scores.") (inspect-index ,integer? "If debugging is set, set beam/slur configuration to this index, and print the respective scores.") (implicit ,boolean? "Is this an implicit bass figure?") + (keep-fixed-while-stretching ,boolean? "A grob with this property set to true will be fixed relative to the staff above it when systems are stretched.") (keep-inside-line ,boolean? "If set, this column cannot have things sticking into the margin.") (kern ,ly:dimension? "Amount of extra white space to add. For @@ -467,6 +466,7 @@ function is to protect objects from being garbage collected.") (arpeggio ,ly:grob? "pointer to arpeggio object.") (beam ,ly:grob? "pointer to the beam, if applicable.") (bracket ,ly:grob? "the bracket for a number.") + (cross-staff ,boolean? "for a beam or a stem, true if we depend on inter-staff spacing") (direction-source ,ly:grob? "in case side-relative-direction is set, which grob to get the direction from .") (dot ,ly:grob? "reference to Dots object.") diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index a31b95dda6..645202e28a 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -319,6 +319,7 @@ (beaming . ,ly:beam::calc-beaming) (stencil . ,ly:beam::print) (clip-edges . #t) + (cross-staff . ,ly:beam::cross-staff) (details . ((hint-direction-penalty . 20))) ;; TODO: should be in SLT. @@ -591,7 +592,6 @@ (Y-offset . ,ly:side-position-interface::y-aligned-side) (staff-padding . 0.1) (padding . 0.6) - (avoid-slur . outside) (slur-padding . 0.3) (minimum-space . 1.2) (direction . ,DOWN) @@ -620,7 +620,6 @@ (font-series . bold) (font-encoding . fetaDynamic) (font-shape . italic) - (avoid-slur . around) (extra-spacing-width . (+inf.0 . -inf.0)) (outside-staff-priority . 250) (meta . ((class . Item) @@ -1229,6 +1228,7 @@ (minimum-length . 1.5) (height-limit . 2.0) (ratio . 0.333) + (cross-staff . ,ly:slur::cross-staff) (meta . ((class . Spanner) (interfaces . (slur-interface)))))) @@ -1427,6 +1427,7 @@ (height-limit . 2.0) (ratio . 0.25) (avoid-slur . inside) + (cross-staff . ,ly:slur::cross-staff) (meta . ((class . Spanner) (interfaces . (slur-interface)))))) @@ -1547,6 +1548,7 @@ (Y-extent . ,ly:stem::height) (length . ,ly:stem::calc-length) (thickness . 1.3) + (cross-staff . ,ly:stem::cross-staff) (details . ( ;; 3.5 (or 3 measured from note head) is standard length diff --git a/scm/layout-page-layout.scm b/scm/layout-page-layout.scm index 5b030d868c..02583858e4 100644 --- a/scm/layout-page-layout.scm +++ b/scm/layout-page-layout.scm @@ -33,9 +33,14 @@ (interval-end system-extent)))))) (define (stretch-and-draw-page paper-book systems page-number ragged last) + (define (max-stretch sys) + (if (ly:grob? sys) + (ly:grob-property sys 'max-stretch) + 0.0)) + (define (stretchable? sys) (and (ly:grob? sys) - (ly:grob-property sys 'stretchable))) + (> (max-stretch sys) 0.0))) (define (height-estimate sys) (interval-length @@ -43,11 +48,6 @@ (ly:grob-property sys 'pure-Y-extent) (paper-system-extent sys Y)))) - (define (max-stretch sys) - (if (stretchable? sys) - (ly:grob-property sys 'max-stretch) - 0.0)) - (define (print-system sys) (if (ly:grob? sys) (ly:system-print sys)