]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-collision.cc
(Introduction): new node.
[lilypond.git] / lily / note-collision.cc
index 82e3dc091c06782a503aa503b2fdf6fcf42daac4..3da3de58c95234d1ab52efb57a5d286b631558e2 100644 (file)
@@ -6,6 +6,8 @@
   (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include <math.h>
+
 #include "warn.hh"
 #include "note-collision.hh"
 #include "note-column.hh"
@@ -69,6 +71,13 @@ check_meshing_chords (Grob *me,
   // FIXME: what's this?
   bool merge_possible = (ups[0] >= dps[0]) && (ups.top () >= dps.top ());
 
+
+
+  /* Do not merge notes typeset in different style. */
+  if ( !gh_equal_p (nu->get_property ("style"),
+                    nd->get_property ("style") ) )
+    merge_possible = false;
+  
   int upball_type = Note_head::get_balltype (nu);
   int dnball_type = Note_head::get_balltype (nd);
   
@@ -237,7 +246,7 @@ check_meshing_chords (Grob *me,
   /* TODO: these numbers are magic; should devise a set of grob props
      to tune this behavior.  */
   else if (stem_to_stem)
-    shift_amount *= -0.65; 
+    shift_amount = -abs (shift_amount) * 0.65; 
   else if (close_half_collide && !touch)
     shift_amount *= 0.52;
   else if (distant_half_collide && !touch)
@@ -284,10 +293,10 @@ Note_collision_interface::do_shifts (Grob* me)
   Real wid = 0.0;
   do
     {
-      if(cg[d].size())
+      if (cg[d].size ())
        {
          Grob  *h = cg[d][0];
-         wid = Note_column::first_head (h)->extent (h,X_AXIS).length() ;
+         wid = Note_column::first_head (h)->extent (h,X_AXIS).length () ;
        }
     }
   while (flip (&d) != UP);