X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbeam.cc;h=c1ad71198a1805e805158578899d341e72b4c155;hb=3f8485925e8c879fe4c9ae86acef9804126c3b91;hp=b38cb8baa6bffa750b265a716134e1f292bbb6cf;hpb=0fdc16375c79b31150cfe459b3388ee3c7784553;p=lilypond.git diff --git a/lily/beam.cc b/lily/beam.cc index b38cb8baa6..c1ad71198a 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -695,7 +695,7 @@ Beam::consider_auto_knees (Grob *me) sets stem directions, a constant shift does not have an influence. */ - head_extents += stem->relative_coordinate (common, Y_AXIS); + head_extents += stem->pure_relative_y_coordinate (common, 0, INT_MAX); if (to_dir (stem->get_property_data ("direction"))) { @@ -974,7 +974,6 @@ Beam::shift_region_to_valid (SCM grob, SCM posns) Real dx = lvs->relative_coordinate (commonx, X_AXIS) - x0; Drul_array pos = ly_scm2interval (posns); - scale_drul (&pos, Staff_symbol_referencer::staff_space (me)); @@ -1421,6 +1420,24 @@ Beam::is_knee (Grob *me) return knee; } +bool +Beam::is_cross_staff (Grob *me) +{ + extract_grob_set (me, "stems", stems); + Grob *staff_symbol = Staff_symbol_referencer::get_staff_symbol (me); + for (vsize i = 0; i < stems.size (); i++) + if (Staff_symbol_referencer::get_staff_symbol (stems[i]) != staff_symbol) + return true; + return false; +} + +MAKE_SCHEME_CALLBACK (Beam, cross_staff, 1) +SCM +Beam::cross_staff (SCM smob) +{ + return scm_from_bool (is_cross_staff (unsmob_grob (smob))); +} + int Beam::get_direction_beam_count (Grob *me, Direction d) {