Add a cross-staff property to rests.
{
public:
DECLARE_SCHEME_CALLBACK (y_offset_callback, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM));
DECLARE_GROB_INTERFACE();
static string glyph_name (Grob *, int, string, bool);
static SCM brew_internal_stencil (Grob*, bool);
return scm_from_double (amount);
}
+/* A rest might lie under a beam, in which case it should be cross-staff if
+ the beam is cross-staff because the rest's position depends on the
+ formatting of the beam. */
+MAKE_SCHEME_CALLBACK (Rest, calc_cross_staff, 1);
+SCM
+Rest::calc_cross_staff (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+ Grob *stem = unsmob_grob (me->get_object ("stem"));
+
+ if (!stem)
+ return SCM_BOOL_F;
+
+ return stem->get_property ("cross-staff");
+}
+
/*
make this function easily usable in C++
*/
(Y-extent . ,ly:rest::height)
(Y-offset . ,ly:rest::y-offset-callback)
(minimum-distance . 0.25)
+ (cross-staff . ,ly:rest::calc-cross-staff)
(meta . ((class . Item)
(interfaces . (font-interface
rhythmic-head-interface