- Grob * d = unsmob_grob (me->get_property ("dot"));
- if (d && bt > 4) // UGH.
- {
- d->set_property ("staff-position",
- gh_int2scm ((bt == 7) ? 4 : 3));
- }
- if (d && bt >= -1 && bt <= 1) // UGH again.
- {
- d->set_property ("staff-position",
- gh_int2scm ((bt == 0) ? -1 : 1));
- }
- return SCM_UNSPECIFIED;
+ if (!position_override)
+ amount += 2 * ss * get_grob_direction (me);;
+
+ 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");