]> git.donarmstrong.com Git - lilypond.git/commit
Clean up DynamicText horizontal alignment.
authorJanek Warchoł <lemniskata.bernoullego@gmail.com>
Fri, 29 Mar 2013 23:11:28 +0000 (00:11 +0100)
committerJanek Warchoł <lemniskata.bernoullego@gmail.com>
Sat, 5 Jul 2014 21:09:29 +0000 (23:09 +0200)
commit09412c25cce3fdffce7cefe491cb3849ece0ae3e
treed005f27208782c94128e63522aea36a4f6e1fa79
parentf4b89d77328e7b583ff9ab287973e9a8b0884a54
Clean up DynamicText horizontal alignment.

Until now, DynamicText alignment was messy, as there were 3 different
callbacks involved - some of them interacting in a confusing way:
 - in define-grobs.scm, X-offset property was initialized to
   ly:self-alignment-interface::x-aligned-on-self,
 - Dynamic_engraver called set_center_parent on every DynamicText
   attached to a note, so that half a NoteHead width was always added
   to its X-offset (producing confusing results for example when
   user requested dynamics to be left-aligned),
 - DynamicTexts living in a Dynamics context used a completely
   different offset callback, which aligned them on NoteColumns.

Since aligned_on_parent is now able to correctly align grobs
with PaperColumn parents (issue 3254), we can use it for all
DynamicTexts and have a single interface for the job.

Expected changes in output: DynamicTexts in Dynamics context
aligned to suspended noteheads may be placed up to 1/4 NoteHead
width further to the right.  This shouldn't be a problem.
lily/dynamic-engraver.cc
lily/include/self-alignment-interface.hh
lily/self-alignment-interface.cc
ly/engraver-init.ly
scm/define-grobs.scm