]> git.donarmstrong.com Git - lilypond.git/commitdiff
stem-engraver.cc: recreate stem if in need of change when merging different heads
authorDavid Kastrup <dak@gnu.org>
Wed, 2 Feb 2011 09:14:11 +0000 (10:14 +0100)
committerDavid Kastrup <dak@gnu.org>
Thu, 7 Apr 2011 19:04:02 +0000 (21:04 +0200)
lily/stem-engraver.cc

index 738eaf8d1eec7e0cd4e2202f2b66c1d6c8fec53b..1d4313b17a2368c7ad0d02a36f1b20a4d0470c17 100644 (file)
@@ -31,7 +31,7 @@
 #include "stem-tremolo.hh"
 #include "stem.hh"
 #include "stream-event.hh"
-
+#include "pointer-group-interface.hh"
 #include "translator.icc"
 
 class Stem_engraver : public Engraver
@@ -157,8 +157,16 @@ Stem_engraver::acknowledge_rhythmic_head (Grob_info gi)
                                                 ds < 0 ? 1 << -ds : 1,
                                                 ds > 0 ? 1 << ds : 1));
       gi.event_cause ()->origin ()->warning (_ ("maybe input should specify polyphonic voices"));
+      if (ds == 1 && dc > 2) {
+       Grob *old_stem = stem_;
+       stem_=0;        
+       make_stem(gi);
+       extract_grob_set (old_stem, "note-heads", heads);
+       for (int i=heads.size(); i--;)
+         Stem::add_head(stem_, heads[i]);
+      }
     }
-
+  
   Stem::add_head (stem_, gi.grob ());
 }