lilypond-user
[Top][All Lists]
Advanced

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

Re: \StaffGroup \consists "Mark_engraver"


From: David Kastrup
Subject: Re: \StaffGroup \consists "Mark_engraver"
Date: Sat, 21 Oct 2017 10:54:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Thomas Morley <address@hidden> writes:

> 2017-10-19 16:15 GMT+02:00 Pierre-Luc Gauthier <address@hidden>:
>> Hi there,
>>
>> I'm trying to move the "Mark_engraver" from the \Score context to the
>> \StaffGroup context so as to have \mark \default be displayed at the
>> top of every new \StaffGroup.
>
> This is
> https://sourceforge.net/p/testlilyissues/issues/2199/
>
> Especially
> https://sourceforge.net/p/testlilyissues/issues/2199/#ad79
> may give you some help.

I see in

git log -p --grep "Move rehearsal marks"


+MAKE_SCHEME_CALLBACK (Side_position_interface, move_to_extremal_staff, 1);
+SCM
+Side_position_interface::move_to_extremal_staff (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  System *sys = dynamic_cast<System*> (me->get_system ());
+  Direction dir = Side_position_interface::get_direction (me);
+  if (dir != DOWN)
+    dir = UP;
+
+  Grob *top_staff = sys->get_extremal_staff (dir, me->extent (sys, X_AXIS));
+
+  if (!top_staff)
+    return SCM_BOOL_F;
+
+  // Only move this grob if it is a direct child of the system.  We
+  // are not interested in moving marks from other staves to the top
+  // staff; we only want to move marks from the system to the top
+  // staff.
+  if (sys != me->get_parent (Y_AXIS))
+    return SCM_BOOL_F;
+
+  me->set_parent (top_staff, Y_AXIS);
+  me->flush_extent_cache (Y_AXIS);
+  Axis_group_interface::add_element (top_staff, me);
+  return SCM_BOOL_T;
+}

In particular, read that comment.  That sounds very much like what the
code is supposed to do doesn't work.  It may have worked at the time of
writing?

Joe, any idea?

-- 
David Kastrup



reply via email to

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