]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/dynamic-engraver.cc
* scripts/lilypond-book.py (LATEX_DOCUMENT): More or less ugly
[lilypond.git] / lily / dynamic-engraver.cc
index 843573fdb3dba434f24a3464ddea064dab28cc44..ab120ab46dd8c45ab2945dc35f0c8b2b06526b9e 100644 (file)
@@ -19,6 +19,7 @@
 #include "side-position-interface.hh"
 #include "staff-symbol-referencer.hh"
 #include "warn.hh"
+#include "self-alignment-interface.hh"
 
 /*
   TODO:
@@ -27,7 +28,7 @@
   line-spanner
 
   - TODO: this engraver is too complicated. We should split it into
-  the handling of the basic grobs and the  linespanner
+  the handling of the basic grobs and the linespanner
 
   - TODO: the line-spanner is not killed after the (de)crescs are
   finished.
@@ -264,13 +265,14 @@ Dynamic_engraver::process_music ()
 void
 Dynamic_engraver::stop_translation_timestep ()
 {
-  typeset_all ();
-  if (!current_cresc_ev_)
+  if (!current_cresc_ev_ && line_spanner_)
     {
+      assert (!finished_line_spanner_);
       finished_line_spanner_ = line_spanner_;
       line_spanner_ = 0;
-      typeset_all ();
     }
+  
+  typeset_all ();
 
   if (cresc_ && !cresc_->get_bound (LEFT))
     {
@@ -382,7 +384,12 @@ Dynamic_engraver::acknowledge_grob (Grob_info info)
        {
          SCM head = scm_last_pair (info.grob ()->get_property ("note-heads"));
          if (scm_is_pair (head))
-           script_->set_parent (unsmob_grob (scm_car (head)), X_AXIS);
+           {
+             script_->set_parent (unsmob_grob (scm_car (head)), X_AXIS);
+             script_->add_offset_callback (Self_alignment_interface::centered_on_parent_proc,
+                                           X_AXIS);
+
+           }
        }
 
       if (cresc_)