- {
- Item *it = dynamic_cast<Item *> (items[i]);
-
- if (d == RIGHT)
- acc_right = acc_right || Note_column::accidentals (it);
-
- Grob *stem = Note_column::get_stem (it);
-
- if (!stem || !stem->is_live ())
- {
- if (d == RIGHT && Separation_item::has_interface (it))
- {
- if (it->get_column () != rcolumn)
- it = it->find_prebroken_piece (rcolumn->break_status_dir ());
-
- Grob *last = Separation_item::extremal_break_aligned_grob (it, LEFT, &bar_xextent);
-
- if (last)
- bar_yextent = Staff_spacing::bar_y_positions (last);
-
- break;
- }
-
- return;
- }
-
- if (Stem::is_invisible (stem))
- {
- correct_stem_dirs = false;
- continue;
- }
-
- 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)
- {
- correct_stem_dirs = false;
- continue;
- }
- 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))
- correct_stem_dirs = false;
-
- Interval hp = Stem::head_positions (stem);
- if (correct_stem_dirs
- && !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);
- }
- }
+ {
+ Item *it = dynamic_cast<Item *> (items[i]);
+ if (!Note_column::has_interface (it))
+ continue;
+ if (d == RIGHT && it->get_column () != rcolumn)
+ continue;
+
+ /*
+ Find accidentals which are sticking out of the right side.
+ */
+ if (d == RIGHT)
+ acc_right = acc_right || Note_column::accidentals (it);
+
+ 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_height (stem, 0, INT_MAX) * (2 / ss);
+ head_posns[d].unite (hp);
+ }
+ }