X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fnote-spacing.cc;h=5cffd5d2053333df09d6782217b10fff2eeb929a;hb=70914e508fe4d9bdde80aeead8a5013491bd2b6e;hp=8153af96358c37f99438cfb31fa31eb2d5a21fd2;hpb=4a401ca1c60f428daa242dbdd102fdb3f327ebfb;p=lilypond.git diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index 8153af9635..5cffd5d205 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -31,6 +31,7 @@ #include "separation-item.hh" #include "spacing-interface.hh" #include "staff-spacing.hh" +#include "staff-symbol-referencer.hh" #include "stem.hh" #include "warn.hh" @@ -273,17 +274,8 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, Interval hp = Stem::head_positions (stem); if (!hp.is_empty ()) { - Real chord_start = hp[stem_dir]; - - /* - can't look at stem-end-position, since that triggers - beam slope computations. - */ - Real stem_end = hp[stem_dir] - + stem_dir * robust_scm2double (stem->get_property ("length"), 7); - - stem_posns[d] = Interval (min (chord_start, stem_end), - max (chord_start, stem_end)); + Real ss = Staff_symbol_referencer::staff_space (stem); + stem_posns[d] = stem->pure_height (stem, 0, INT_MAX) * (2 / ss); head_posns[d].unite (hp); } } @@ -304,7 +296,6 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, if (beams_drul[LEFT] && beams_drul[LEFT] == beams_drul[RIGHT]) { correction = knee_correction (me, stems_drul[RIGHT], increment); - *fixed += correction; } else { @@ -322,6 +313,7 @@ Note_spacing::stem_dir_correction (Grob *me, Item *rcolumn, && !acc_right) correction = same_direction_correction (me, head_posns); + *fixed += correction; *space += correction; /* there used to be a correction for bar_xextent () here, but