]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #362 (2)
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 8 Jun 2007 01:15:04 +0000 (22:15 -0300)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 8 Jun 2007 01:15:04 +0000 (22:15 -0300)
Try not to look at height of a stem in rest collisions.

input/regression/dot-column-rest-collision.ly [new file with mode: 0644]
lily/include/note-column.hh
lily/rest-collision.cc

diff --git a/input/regression/dot-column-rest-collision.ly b/input/regression/dot-column-rest-collision.ly
new file mode 100644 (file)
index 0000000..f706d4e
--- /dev/null
@@ -0,0 +1,10 @@
+\header {
+  texidoc = "Dot columns do not trigger beam slanting too early."
+}
+
+\version "2.11.26"
+\paper{ ragged-right=##t }
+<<
+  { e''8 e''8 g'' g''} \\
+  { e8 r4. }
+>>
index 429b83af3ef29968ac0b6650c96eccf5a35e1e55..8646f120fed818d568d7aa54b061602b326c09cf 100644 (file)
@@ -26,7 +26,6 @@ public:
   static Grob *accidentals (Grob *me);
   static Grob *arpeggio (Grob *me);
   static Slice head_positions_interval (Grob *me);
-  static Direction static_dir (Grob *);
   static void translate_rests (Grob *me, int dy);
   static Grob *first_head (Grob *me);
   static Grob *get_rest (Grob *me);
index 063b773a92ae2f3ccf58792ba566095bf884b0a2..dd92f083e36db01a468dcc5a2acf9d1299cd11ad 100644 (file)
@@ -227,8 +227,24 @@ Rest_collision::calc_positioning_done (SCM smob)
 
       Interval notedim;
       for (vsize i = 0; i < notes.size (); i++)
-       notedim.unite (notes[i]->extent (common, Y_AXIS));
-
+       {
+         if (Note_column::dir (notes[i]) == -dir)
+           {
+             /* try not to look at the stem, as looking at a beamed
+                note may trigger beam positioning prematurely.
+
+                This happens with dotted rests, which need Y
+                positioning to compute X-positioning.
+             */
+             Grob *head = Note_column::first_head (notes[i]);
+             if (head)
+               notedim.unite (head->extent (common, Y_AXIS));
+             else
+               programming_error ("Note_column without first_head()");
+           }
+         else
+           notedim.unite (notes[i]->extent (common, Y_AXIS));
+       }
 
       Real y = dir * max (0.0,
                          -dir * restdim[-dir] + dir * notedim[dir]  + minimum_dist);