+ // In the case of a stem, we will find a note head as well
+ // ignoring the stem solves cyclic dependencies if the stem is
+ // attached to a cross-staff beam.
+ if (a == Y_AXIS
+ && Stem::has_interface (e)
+ && dir == - get_grob_direction (e))
+ continue;
+
+ if (e)
+ {
+ if (Accidental_interface::has_interface (e))
+ {
+ vector<Box> bs = Accidental_interface::accurate_boxes (e, common);
+ boxes.insert (boxes.end (), bs.begin (), bs.end ());
+ }
+ else
+ {
+ if (Note_column::has_interface (e->get_parent (X_AXIS))
+ && to_boolean (me->get_property ("add-stem-support")))
+ {
+ note_column_map[e->get_parent (X_AXIS)].push_back (e);
+ continue;
+ }
+
+ Skyline_pair *sp = Skyline_pair::unsmob (e->get_property ("vertical-skylines"));
+ if (sp && a == Y_AXIS && !pure)
+ {
+ Skyline_pair copy = Skyline_pair (*sp);
+ copy.shift (e->relative_coordinate (common[X_AXIS], X_AXIS));
+ copy.raise (e->relative_coordinate (common[Y_AXIS], Y_AXIS));
+ skyps.push_back (copy);
+ continue;
+ }
+ Box b;
+ for (Axis ax = X_AXIS; ax < NO_AXES; incr (ax))
+ b[ax] = e->maybe_pure_extent (common[ax], ax, pure, start, end);
+
+ if (b[X_AXIS].is_empty () || b[Y_AXIS].is_empty ())
+ continue;
+
+ boxes.push_back (b);
+ min_h = minmax (dir, b[a][-dir], min_h);
+ }
+ }
+ }
+
+ // this loop ensures that parts of a note column will be in the same box
+ // pushes scripts and such over stems instead of just over heads
+ for (map<Grob *, vector<Grob *> >::iterator i = note_column_map.begin (); i != note_column_map.end (); i++)
+ {
+ Box big;
+ for (vsize j = 0; j < (*i).second.size (); j++)
+ {
+ Grob *e = (*i).second[j];
+ Box b;
+ for (Axis ax = X_AXIS; ax < NO_AXES; incr (ax))
+ b[ax] = e->maybe_pure_extent (common[ax], ax, pure, start, end);
+
+ if (b[X_AXIS].is_empty () || b[Y_AXIS].is_empty ())
+ continue;
+
+ big.unite (b);
+ }
+ if (!big[X_AXIS].is_empty () && !big[Y_AXIS].is_empty ())
+ boxes.push_back (big);