X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Fbend-engraver.cc;h=4545fb7297c0202c5105b926ec5ff99abbaa191b;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=9f5602fef096ccde37a9a10fedb01aeb5116c0ab;hpb=41e45dd730c075e78065dfa78e5e54be664d905e;p=lilypond.git diff --git a/lily/bend-engraver.cc b/lily/bend-engraver.cc index 9f5602fef0..4545fb7297 100644 --- a/lily/bend-engraver.cc +++ b/lily/bend-engraver.cc @@ -1,7 +1,7 @@ /* bend-engraver.cc -- implement Bend_engraver - (c) 2006--2007 Han-Wen Nienhuys + (c) 2006--2008 Han-Wen Nienhuys */ @@ -22,6 +22,7 @@ public: protected: DECLARE_TRANSLATOR_LISTENER (bend_after); + void finalize (); void process_music (); void stop_translation_timestep (); void start_translation_timestep (); @@ -31,9 +32,19 @@ private: Moment stop_moment_; Stream_event *fall_event_; Spanner *fall_; + Spanner *last_fall_; Grob *note_head_; }; +void +Bend_engraver::finalize () +{ + // We shouldn't end a spanner on the last musical column of a piece because then + // it would extend past the last breakable column of the piece. + if (last_fall_) + last_fall_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn"))); +} + void Bend_engraver::stop_fall () { @@ -43,6 +54,7 @@ Bend_engraver::stop_fall () fall_->set_bound (RIGHT, unsmob_grob (bar ? get_property ("currentCommandColumn") : get_property ("currentMusicalColumn"))); + last_fall_ = fall_; fall_ = 0; note_head_ = 0; fall_event_ = 0; @@ -61,6 +73,8 @@ Bend_engraver::stop_translation_timestep () void Bend_engraver::start_translation_timestep () { + last_fall_ = 0; + if (fall_ && now_mom ().main_part_ >= stop_moment_.main_part_) { stop_fall (); @@ -86,6 +100,7 @@ Bend_engraver::acknowledge_note_head (Grob_info info) Bend_engraver::Bend_engraver () { fall_ = 0; + last_fall_ = 0; note_head_ = 0; fall_event_ = 0; }