]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #362.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 4 Jun 2007 02:49:57 +0000 (23:49 -0300)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 4 Jun 2007 02:49:57 +0000 (23:49 -0300)
Don't request stem_end for beamed note when formatting semities.

input/regression/laissez-vibrer-tie-beam.ly [new file with mode: 0644]
lily/include/tie-formatting-problem.hh
lily/tie-formatting-problem.cc

diff --git a/input/regression/laissez-vibrer-tie-beam.ly b/input/regression/laissez-vibrer-tie-beam.ly
new file mode 100644 (file)
index 0000000..b9ad29a
--- /dev/null
@@ -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
+}
index 50f1746b86ba374abb138d9e1a2372051fb16fff..cb7d8c6e1632b51c3bc61db0af335c5d38b4f558 100644 (file)
@@ -42,6 +42,7 @@ class Tie_formatting_problem
   set<int> dot_positions_;
   Interval dot_x_;
   vector<Tie_specification> specifications_;
+  bool use_horizontal_spacing_;
   
   Tie_configuration_map possibilities_;
 
index f7682c904c56db5af97bcd4c9c3f0c240e6a7b84..3105d784f1615a8e9ec459bfeb99289fa6bb3e1c 100644 (file)
@@ -61,6 +61,7 @@ Tie_formatting_problem::get_attachment (Real y, Drul_array<int> 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<Item*> 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<Grob*> const &semi_ties, Directio
 {
   if (semi_ties.empty ())
     return;
-  
+
+  use_horizontal_spacing_ = false; 
   details_.from_grob (semi_ties[0]);
   vector<Item*> heads;