bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue 1194 in lilypond: Dynamics are differently positioned on rest


From: lilypond
Subject: Re: Issue 1194 in lilypond: Dynamics are differently positioned on rests than on notes
Date: Fri, 23 Jul 2010 16:02:58 +0000


Comment #5 on issue 1194 by address@hidden: Dynamics are differently positioned on rests than on notes
http://code.google.com/p/lilypond/issues/detail?id=1194

As I'm also very interested in a solution to this problem I copy a message by Neil Puttock on bug-lilypond:

"This is the same problem you get with the Dynamics context, where the
dynamics are aligned to paper columns.

This, from New_dynamic_engraver::acknowledge_note_column (),  is
probably the source of the bug:

 227   if (script_ && !script_->get_parent (X_AXIS))
 228     {
 229       extract_grob_set (info.grob (), "note-heads", heads);
 230       if (heads.size ())
 231         {
 232           Grob *head = heads[0];
 233           script_->set_parent (head, X_AXIS);
234 Self_alignment_interface::set_center_parent (script_, X_AXIS);
 235         }
 236     }

Where there's only a rest, the NoteColumn has no cached noteheads, so
the default X-parent lands on a PaperColumn, and there's no centring.

Perhaps something like this would be better (obviously would need a
comment to explain the special case for a NoteColumn containing a
single rest):

  if (script_ && !script_->get_parent (X_AXIS))
    {

      extract_grob_set (info.grob (), "note-heads", heads);
      Grob *x_parent = (heads.size ()
                        ? heads[0]
                        : unsmob_grob (info.grob ()->get_object ("rest")));
        if (x_parent)
          {
            script_->set_parent (x_parent, X_AXIS);
            Self_alignment_interface::set_center_parent (script_, X_AXIS);
          }
    }

Cheers,
Neil
"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]