From d060f0152577ccb01bfa3d4c50a3f91d676573ca Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 3 Jun 2007 23:49:57 -0300 Subject: [PATCH] Fix #362. Don't request stem_end for beamed note when formatting semities. --- input/regression/laissez-vibrer-tie-beam.ly | 17 +++++++++++++++++ lily/include/tie-formatting-problem.hh | 1 + lily/tie-formatting-problem.cc | 21 +++++++++++++++------ 3 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 input/regression/laissez-vibrer-tie-beam.ly diff --git a/input/regression/laissez-vibrer-tie-beam.ly b/input/regression/laissez-vibrer-tie-beam.ly new file mode 100644 index 0000000000..b9ad29a2fc --- /dev/null +++ b/input/regression/laissez-vibrer-tie-beam.ly @@ -0,0 +1,17 @@ +\header { + + texidoc = "@code{\laissezVibrer} ties on beamed notes don't trigger +premature beam slope calculation. " + +} + +\version "2.11.26" + +\paper{ + ragged-right=##t +} + +{ + c'8 e' g' c''\laissezVibrer r2 | + c'8 e' g' c'' r2 +} diff --git a/lily/include/tie-formatting-problem.hh b/lily/include/tie-formatting-problem.hh index 50f1746b86..cb7d8c6e16 100644 --- a/lily/include/tie-formatting-problem.hh +++ b/lily/include/tie-formatting-problem.hh @@ -42,6 +42,7 @@ class Tie_formatting_problem set dot_positions_; Interval dot_x_; vector specifications_; + bool use_horizontal_spacing_; Tie_configuration_map possibilities_; diff --git a/lily/tie-formatting-problem.cc b/lily/tie-formatting-problem.cc index f7682c904c..3105d784f1 100644 --- a/lily/tie-formatting-problem.cc +++ b/lily/tie-formatting-problem.cc @@ -61,6 +61,7 @@ Tie_formatting_problem::get_attachment (Real y, Drul_array columns) const Tie_formatting_problem::Tie_formatting_problem () { x_refpoint_ = 0; + use_horizontal_spacing_ = true; } Tie_formatting_problem::~Tie_formatting_problem () @@ -123,16 +124,23 @@ Tie_formatting_problem::set_column_chord_outline (vector bounds, { if (Stem::is_normal_stem (stem)) { - Interval x; x.add_point (stem->relative_coordinate (x_refpoint_, X_AXIS)); x.widen (staff_space / 20); // ugh. Interval y; - Real stem_end_position = - Stem::is_cross_staff (stem) - ? get_grob_direction (stem) * infinity_f - : Stem::stem_end_position (stem) * staff_space * .5; + Real stem_end_position = 0.0; + if (Stem::is_cross_staff (stem)) + stem_end_position = get_grob_direction (stem) * infinity_f; + else + { + if (use_horizontal_spacing_ || !Stem::get_beam (stem)) + stem_end_position = Stem::stem_end_position (stem) * staff_space * .5; + else + stem_end_position = Stem::note_head_positions (stem)[get_grob_direction (stem)] + * staff_space * .5; + } + y.add_point (stem_end_position); Direction stemdir = get_grob_direction (stem); @@ -347,7 +355,8 @@ Tie_formatting_problem::from_semi_ties (vector const &semi_ties, Directio { if (semi_ties.empty ()) return; - + + use_horizontal_spacing_ = false; details_.from_grob (semi_ties[0]); vector heads; -- 2.39.5