- for (SCM s = props[d]; gh_pair_p (s); s = gh_cdr (s))
- {
- Item * it= dynamic_cast<Item*> (unsmob_grob (gh_car(s)));
-
- if (d == RIGHT)
- acc_right = acc_right || Note_column::accidentals (it);
-
- Grob *stem = Note_column::get_stem (it);
-
- if (!stem || !stem->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 = Staff_spacing::extremal_break_aligned_grob (it, LEFT, &bar_xextent);
-
- if (last)
- bar_yextent = Staff_spacing::bar_y_positions (last);
-
- break;
- }
-
- return ;
- }
-
- if(Stem::invisible_b (stem))
- {
- correct_stem_dirs = false;
- continue;
- }
-
- beams_drul[d] = Stem::get_beam (stem);
-
-
- Direction sd = Stem::get_direction (stem);
- if (stem_dirs[d] && stem_dirs[d] != sd)
- {
- correct_stem_dirs = false;
- continue;
- }
- stem_dirs[d] = sd;
-
- /*
- 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);
- Real chord_start = hp[sd];
- Real stem_end = Stem::stem_end_position (stem);
-
- stem_posns[d] = Interval(chord_start<?stem_end, chord_start>? stem_end);
- head_posns[d].unite (hp);
- }
+ vector<Grob *> const &items (ly_scm2link_array (props [d]));
+ for (vsize i = 0; i < items.size (); i++)
+ {
+ 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);
+ }
+ }