From a00fa3d9a28af688cf3bf3dcc8636f2e0cb39117 Mon Sep 17 00:00:00 2001 From: Mike Solomon Date: Fri, 10 Feb 2012 08:30:01 +0100 Subject: [PATCH] Implements bound-alignment-interfaces for NonMusicalPaperColumn. This includes all grobs save break-alignable grobs usch as MetronomeMark and RehearsalMark. --- .../regression/metronome-mark-broken-bound.ly | 36 +++++++++++++++++++ lily/beam.cc | 5 +-- lily/hairpin.cc | 6 ++-- lily/lyric-hyphen.cc | 6 ++-- lily/ottava-bracket.cc | 3 +- lily/tuplet-bracket.cc | 11 +++--- scm/define-grobs.scm | 1 + 7 files changed, 56 insertions(+), 12 deletions(-) create mode 100644 input/regression/metronome-mark-broken-bound.ly diff --git a/input/regression/metronome-mark-broken-bound.ly b/input/regression/metronome-mark-broken-bound.ly new file mode 100644 index 0000000000..a4d1cf2487 --- /dev/null +++ b/input/regression/metronome-mark-broken-bound.ly @@ -0,0 +1,36 @@ +\version "2.15.28" + +\header { +texidoc = "A @code{MetronomeMark}, @code{RehearsalMark} and @code{BarNumber} +should not effect the starting point of spanners. +" +} + +<< + \new Staff { + e'1 \time 4/4 \break | + \tempo \markup { "fooooo" } 4 = 90 + e'1 | + e'1 | + } + + \new Staff { + \override Score.MetronomeMark #'break-visibility = #all-visible + \override TupletBracket #'breakable = ##t + \override Beam #'breakable = ##t + \override Glissando #'breakable = ##t + + \ottava #1 \times 1/1 { e'8\<\startTextSpan\startTrillSpan\glissando + [ \override NoteColumn #'glissando-skip = ##t\repeat unfold 22 e'8 + \revert NoteColumn #'glissando-skip e'8\!\stopTextSpan\stopTrillSpan ] } | + } + \addlyrics { ah __ \repeat unfold 21 { \skip 4 } _ rrgh } + \addlyrics { ah -- \repeat unfold 21 { \skip 4 } _ rrgh } +>> + +\layout { + \context { + \Voice + \remove "Forbid_line_break_engraver" + } +} diff --git a/lily/beam.cc b/lily/beam.cc index d0b975ec04..4a27d648e1 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -37,6 +37,7 @@ #include "beam.hh" +#include "axis-group-interface.hh" #include "align-interface.hh" #include "beam-scoring-problem.hh" #include "beaming-pattern.hh" @@ -483,8 +484,8 @@ Beam::calc_beam_segments (SCM smob) && me->get_bound (event_dir)->break_status_dir ()) { current.horizontal_[event_dir] - = (robust_relative_extent (me->get_bound (event_dir), - commonx, X_AXIS)[RIGHT] + = (Axis_group_interface::generic_bound_extent (me->get_bound (event_dir), + commonx, X_AXIS)[RIGHT] + event_dir * break_overshoot[event_dir]); } else diff --git a/lily/hairpin.cc b/lily/hairpin.cc index bf590a564b..7ef0f847a1 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -165,9 +165,9 @@ Hairpin::print (SCM smob) do { Item *b = bounds[d]; - Interval e = (Axis_group_interface::has_interface (b) - ? Axis_group_interface::generic_bound_extent (b, common, X_AXIS) - : robust_relative_extent (b, common, X_AXIS)); + Interval e = (Paper_column::has_interface (b) && b->break_status_dir ()) + ? Axis_group_interface::generic_bound_extent (b, common, X_AXIS) + : robust_relative_extent (b, common, X_AXIS); x_points[d] = b->relative_coordinate (common, X_AXIS); if (broken [d]) diff --git a/lily/lyric-hyphen.cc b/lily/lyric-hyphen.cc index 86ae8cdc65..4ce2fddeb8 100644 --- a/lily/lyric-hyphen.cc +++ b/lily/lyric-hyphen.cc @@ -19,6 +19,7 @@ #include "lyric-hyphen.hh" +#include "axis-group-interface.hh" #include "lookup.hh" #include "output-def.hh" #include "paper-column.hh" @@ -47,10 +48,11 @@ Lyric_hyphen::print (SCM smob) Interval span_points; Direction d = LEFT; - Drul_array broken; do { - Interval iv = bounds[d]->extent (common, X_AXIS); + Interval iv = bounds[d]->break_status_dir () + ? Axis_group_interface::generic_bound_extent (bounds[d], common, X_AXIS) + : robust_relative_extent (bounds[d], common, X_AXIS); span_points[d] = iv.is_empty () ? bounds[d]->relative_coordinate (common, X_AXIS) diff --git a/lily/ottava-bracket.cc b/lily/ottava-bracket.cc index 38040342ca..cbe9928b6e 100644 --- a/lily/ottava-bracket.cc +++ b/lily/ottava-bracket.cc @@ -17,6 +17,7 @@ along with LilyPond. If not, see . */ +#include "axis-group-interface.hh" #include "text-interface.hh" #include "spanner.hh" #include "font-interface.hh" @@ -114,7 +115,7 @@ Ottava_bracket::print (SCM smob) if (broken[d]) { - span_points[d] = b->extent (common, X_AXIS)[RIGHT]; + span_points[d] = Axis_group_interface::generic_bound_extent (b, common, X_AXIS)[RIGHT]; shorten[d] = 0.; } diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index dbbd782cfb..40e0c728c5 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -41,6 +41,7 @@ */ #include "tuplet-bracket.hh" +#include "axis-group-interface.hh" #include "line-interface.hh" #include "beam.hh" #include "warn.hh" @@ -203,8 +204,9 @@ Tuplet_bracket::calc_x_positions (SCM smob) Direction d = LEFT; do { - x_span[d] = robust_relative_extent (bounds[d], commonx, X_AXIS)[d]; - + x_span[d] = bounds[d]->break_status_dir () + ? Axis_group_interface::generic_bound_extent (bounds[d], commonx, X_AXIS)[d] + : robust_relative_extent (bounds[d], commonx, X_AXIS)[d]; if (connect_to_other[d]) { Interval overshoot (robust_scm2drul (me->get_property ("break-overshoot"), @@ -213,8 +215,9 @@ Tuplet_bracket::calc_x_positions (SCM smob) if (d == RIGHT) x_span[d] += d * overshoot[d]; else - x_span[d] = robust_relative_extent (bounds[d], - commonx, X_AXIS)[RIGHT] + x_span[d] = (bounds[d]->break_status_dir () + ? Axis_group_interface::generic_bound_extent (bounds[d], commonx, X_AXIS)[-d] + : robust_relative_extent (bounds[d], commonx, X_AXIS)[-d]) - overshoot[LEFT]; } diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 97645233c6..1b9507a0b8 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -1417,6 +1417,7 @@ (allow-loose-spacing . #t) (axes . (,X)) (before-line-breaking . ,ly:paper-column::before-line-breaking) + (bound-alignment-interfaces . (break-alignment-interface)) (full-measure-extra-space . 1.0) (horizontal-skylines . ,ly:separation-item::calc-skylines) ;; (stencil . ,ly:paper-column::print) -- 2.39.2