X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fnew-dynamic-engraver.cc;h=e225d97f1fd1bf4285988c27700839ebb3bca595;hb=e3a15ec3c1951dd16f6ee71fbd79870d9e2fb3a0;hp=497fc0b7f710c145c1b44310e4d9c86618282118;hpb=a6bd229f7fe1dc4a03478e14ccc0c0c66b225061;p=lilypond.git diff --git a/lily/new-dynamic-engraver.cc b/lily/new-dynamic-engraver.cc index 497fc0b7f7..e225d97f1f 100644 --- a/lily/new-dynamic-engraver.cc +++ b/lily/new-dynamic-engraver.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2008--2010 Han-Wen Nienhuys + Copyright (C) 2008--2011 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -227,10 +227,16 @@ New_dynamic_engraver::acknowledge_note_column (Grob_info info) if (script_ && !script_->get_parent (X_AXIS)) { extract_grob_set (info.grob (), "note-heads", heads); - if (heads.size ()) + /* + Spacing constraints may require dynamics to be aligned on rests, + so check for a rest if this note column has no note heads. + */ + Grob *x_parent = (heads.size () + ? heads[0] + : unsmob_grob (info.grob ()->get_object ("rest"))); + if (x_parent) { - Grob *head = heads[0]; - script_->set_parent (head, X_AXIS); + script_->set_parent (x_parent, X_AXIS); Self_alignment_interface::set_center_parent (script_, X_AXIS); } } @@ -244,10 +250,7 @@ New_dynamic_engraver::acknowledge_note_column (Grob_info info) ADD_ACKNOWLEDGER (New_dynamic_engraver, note_column); ADD_TRANSLATOR (New_dynamic_engraver, /* doc */ - "Create hairpins, dynamic texts, and their vertical" - " alignments. The symbols are collected onto a" - " @code{DynamicLineSpanner} grob which takes care of vertical" - " positioning.", + "Create hairpins, dynamic texts and dynamic text spanners.", /* create */ "DynamicTextSpanner "