]> git.donarmstrong.com Git - lilypond.git/commit - lily/metronome-engraver.cc
Fix #1695: Clef change placed outside score.
authorNeil Puttock <n.puttock@gmail.com>
Wed, 20 Jul 2011 14:49:45 +0000 (15:49 +0100)
committerNeil Puttock <n.puttock@gmail.com>
Wed, 20 Jul 2011 14:50:43 +0000 (15:50 +0100)
commitbebd93c2dd0d7363f311d912ec1ed1f7dfcb36ba
treef4cdfb99f1b9af104162055ceef68168a045de23
parent3e8b3eb5e3e2054fdaf5b8bc71b1222c7db5ebe5
Fix #1695: Clef change placed outside score.

A MetronomeMark represents a special case for a break-alignable grob, since
sometimes it will be aligned on noteheads rather than prefatory material.  In
this case, we don't want it to be acknowledged by the Break_align_engraver,
since it will hijack the X-parent before the Metronome_engraver can set it at
the end of the timestep.  This causes the Paper_column_engraver to add the
MetronomeMark to the 'elements list of a NonMusicalPaperColumn.  If this paper
column is loose, its X-extent calculation will be incorrect, since it includes
the extent of the MetronomeMark whose refpoint is different (a System).
This results in the column being translated away from the MetronomeMark into the
left margin.

This patch fixes issue 1695 by removing the default setting for 'non-musical and
setting it dynamically in the Metronome_engraver.  Note that this isn't
sufficient in itself since `non-musical' checks use Item::non_musical (), which
recursively checks parents; in the case where a MetronomeMark is effectively
musical (i.e., aligned on a notehead, and parented by a PaperColumn), we also
need to return from the Break_align_engraver without potentially creating a
new BreakAlignment and setting the temporary X-parent.

* input/regression/metronome-mark-loose-column.ly:

  new regtest

* lily/break-align-engraver.cc (acknowledge_break_alignable):

  return if ack'd grob is musical (only applies to MetronomeMark)

* lily/metronome-engraver.cc (acknowledge_break_aligned):

  if a valid break-aligned grob has been ack'd, set non-musical for
  MetronomeMark

* scm/define-grobs.scm (all-grob-descriptions):

  remove default setting for non-musical in MetronomeMark definition
(cherry picked from commit 70f52d14e861d3afa78508fb735b1d4e7bb274a3)
input/regression/metronome-mark-loose-column.ly [new file with mode: 0644]
lily/break-align-engraver.cc
lily/metronome-engraver.cc
scm/define-grobs.scm