]> git.donarmstrong.com Git - lilypond.git/commit
Fix 1259/1433: linebreaks with \breakDynamicSpan or spanners with style=#'none
authorReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 24 Jun 2011 20:43:55 +0000 (22:43 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Thu, 28 Jul 2011 11:52:17 +0000 (13:52 +0200)
commitcf3642858a2340bb39ee56739f34c799946d4454
tree98976b04d5910dd7dacbcc83e8a5ff700f10345e
parent72210831b0366cb7c1f7009ba99a56538d68a7e5
Fix  1259/1433: linebreaks with \breakDynamicSpan or spanners with style=#'none

This patch changes the way DynamicLineSpanners are handled when
\breakDynamicSpan is called or when the DynamicTextSpanner's style=#'none
(i.e. no line should be used and thus the spanner should also not
unneccessarily shift the dynamic text spanner up/down).

So far, this was handled by simply ending the DynamicLineSpanner prematurely,
while leaving its children at their full length. As a consequence, the child
spanners were no longer fully contained in the DynamicLineSpanner, which
caused several problem at line breaks.

This patch changes it as follows:
-) All spanner breaks are handled by a flag set on the spanner itself
-) The breakDynamicSpan events are handled by the dynamic engraver, which will
   set that flag (no longer handled by the dynamic span engraver!).
 This allows to obey the order of \breakDynamicSpan and \> (i.e. if the
 break was before the \< then break the previous spanner, if it was placed
 afterwards then end the newly created spanner)
-) When a DynamicTextSpanner with style=#'none or a \breakDynamicSpan
   is encountered, I also set that flag immediately after spanner creation
-) From then on, no new dynamics are added to the line spanner and no
   new support points are added that would otherwise shift the spanner
   if there is a very high/low note or articulation. If the spanner creates
   a grob (like a hairpin), that grob would still be shifted as a grob
   to prevent collisions, though.
-) When the current child spanner is ended, we also end the DynamicLineSpanner
   (and store it in a temporary variable so that we can properly end it
   in stop_translation_timestep). If a new dynamic is encountered, it will
   then create a completely new DynamicLineSpanner, which provides the
   independent alignment that we want.

This fixes both issues 1259 and 1433.
input/regression/dynamics-alignment-breaker-linebreak.ly [new file with mode: 0644]
input/regression/dynamics-alignment-breaker-order.ly [new file with mode: 0644]
input/regression/dynamics-alignment-breaker-subsequent-spanner.ly [new file with mode: 0644]
input/regression/dynamics-alignment-no-line-linebreak.ly [new file with mode: 0644]
lily/dynamic-align-engraver.cc
lily/new-dynamic-engraver.cc
lily/spanner.cc
scm/define-grob-properties.scm