- {
- /* this shouldn't happen, but let's continue anyway. */
- programming_error ("Separation_item: I've been drinking too much");
- continue; /*UGH UGH*/
- }
-
- if (to_boolean (il->get_property ("no-spacing-rods")))
- continue;
-
- Interval iv (il->extent (pc, X_AXIS));
- if (!iv.is_empty ())
- w.unite (iv);
+ continue;
+
+ /* ugh. We want to exclude groups of grobs (so that we insert each grob
+ individually into the skyline instead of adding a single box that
+ bounds all of them). However, we can't exclude an axis-group that
+ adds to its childrens' stencil. Currently, this is just TrillPitchGroup;
+ hence the check for note-head-interface. */
+ if (has_interface<Axis_group_interface> (il)
+ && !has_interface<Note_head> (il))
+ continue;
+
+ Interval y (il->pure_y_extent (ycommon, 0, very_large));
+ Interval x (il->extent (pc, X_AXIS));
+
+ Interval extra_width = robust_scm2interval (elts[i]->get_property ("extra-spacing-width"),
+ Interval (-0.1, 0.1));
+ Interval extra_height = robust_scm2interval (elts[i]->get_property ("extra-spacing-height"),
+ Interval (0.0, 0.0));
+
+ // The conventional empty extent is (+inf.0 . -inf.0)
+ // but (-inf.0 . +inf.0) is used as extra-spacing-height
+ // on items that must not overlap other note-columns.
+ // If these two uses of inf combine, leave the empty extent.
+
+ if (!isinf (x[LEFT]))
+ x[LEFT] += extra_width[LEFT];
+ if (!isinf (x[RIGHT]))
+ x[RIGHT] += extra_width[RIGHT];
+ if (!isinf (y[DOWN]))
+ y[DOWN] += extra_height[DOWN];
+ if (!isinf (y[UP]))
+ y[UP] += extra_height[UP];
+
+ if (!x.is_empty () && !y.is_empty ())
+ out.push_back (Box (x, y));