diff options
author | Jan Nieuwenhuizen <janneke@gnu.org> | 2011-02-21 21:04:52 +0100 |
---|---|---|
committer | Jan Nieuwenhuizen <janneke@gnu.org> | 2011-02-21 21:04:52 +0100 |
commit | 3d5e7223a0ff02119c18f0be39873647bf686d3b (patch) | |
tree | ac2c3b2eb53019960fc92f10390e5fb4b09e652b | |
parent | 7bb304912f9b9752591abc4216d764a99012b90a (diff) |
Completion_heads_engraver: retain note shape for non-tuplets. Fixes #1532.
-rw-r--r-- | input/regression/completion-heads-factor.ly | 25 | ||||
-rw-r--r-- | lily/completion-note-heads-engraver.cc | 9 |
2 files changed, 31 insertions, 3 deletions
diff --git a/input/regression/completion-heads-factor.ly b/input/regression/completion-heads-factor.ly new file mode 100644 index 0000000000..a065a37e0b --- /dev/null +++ b/input/regression/completion-heads-factor.ly @@ -0,0 +1,25 @@ +\version "2.12.0" + +\header{ +texidoc=" + +If the @code{Note_heads_engraver} is replaced by the @code{Completion_heads_engraver}, +notes with a duration factor still keep their requested appearance. + +" +} + +#(set-paper-size "a6") + +\layout { ragged-right= ##t } + + +\new Voice \with { + \remove "Note_heads_engraver" + \consists "Completion_heads_engraver" +} \relative c'{ + + c\breve | + c1*2 | + c2*4 | +} diff --git a/lily/completion-note-heads-engraver.cc b/lily/completion-note-heads-engraver.cc index 0b1a0565ba..59b47ab525 100644 --- a/lily/completion-note-heads-engraver.cc +++ b/lily/completion-note-heads-engraver.cc @@ -218,11 +218,14 @@ Completion_heads_engraver::process_music () event = event->clone (); SCM pits = note_events_[i]->get_property ("pitch"); + Duration appearance = note_dur; + if (factor_.denominator () == 1 && factor_ > Rational (1, 1)) + appearance = Duration (note_dur.get_length (), false); event->set_property ("pitch", pits); - event->set_property ("duration", note_dur.smobbed_copy ()); - event->set_property ("length", Moment (note_dur.get_length ()).smobbed_copy ()); - event->set_property ("duration-log", scm_from_int (note_dur.duration_log ())); + event->set_property ("duration", appearance.smobbed_copy ()); + event->set_property ("length", Moment (appearance.get_length ()).smobbed_copy ()); + event->set_property ("duration-log", scm_from_int (appearance.duration_log ())); Item *note = make_note_head (event); if (need_clone) |