- Grob *stem = Note_column::get_stem (it);
-
- if (!stem || !stem->is_live () || Stem::is_invisible (stem))
- return;
-
- stems_drul[d] = stem;
- beams_drul[d] = Stem::get_beam (stem);
-
- Direction stem_dir = get_grob_direction (stem);
- if (stem_dirs[d] && stem_dirs[d] != stem_dir)
- return;
-
- stem_dirs[d] = stem_dir;
-
- /*
- Correction doesn't seem appropriate when there is a large flag
- hanging from the note.
- */
- if (d == LEFT
- && Stem::duration_log (stem) > 2 && !Stem::get_beam (stem))
- return;
-
- 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));
- head_posns[d].unite (hp);
- }
- }
+ Grob *stem = Note_column::get_stem (it);
+
+ if (!stem || !stem->is_live () || Stem::is_invisible (stem))
+ return;
+
+ stems_drul[d] = stem;
+ beams_drul[d] = Stem::get_beam (stem);
+
+ Direction stem_dir = get_grob_direction (stem);
+ if (stem_dirs[d] && stem_dirs[d] != stem_dir)
+ return;
+
+ stem_dirs[d] = stem_dir;
+
+ /*
+ Correction doesn't seem appropriate when there is a large flag
+ hanging from the note.
+ */
+ if (d == LEFT
+ && Stem::duration_log (stem) > 2 && !Stem::get_beam (stem))
+ return;
+
+ Interval hp = Stem::head_positions (stem);
+ if (!hp.is_empty ())
+ {
+ Real ss = Staff_symbol_referencer::staff_space (stem);
+ stem_posns[d] = stem->pure_y_extent (stem, 0, INT_MAX) * (2 / ss);
+ head_posns[d].unite (hp);
+ }
+ }