+ if (!pure)
+ {
+ Skyline_pair *skys = Skyline_pair::unsmob (g->get_property (a == Y_AXIS
+ ? "vertical-skylines"
+ : "horizontal-skylines"));
+ if (skys)
+ skylines = *skys;
+
+ /* this is perhaps an abuse of minimum-?-extent: maybe we should create
+ another property? But it seems that the only (current) use of
+ minimum-Y-extent is to separate vertically-aligned elements */
+ SCM min_extent = g->get_property (a == X_AXIS
+ ? ly_symbol2scm ("minimum-X-extent")
+ : ly_symbol2scm ("minimum-Y-extent"));
+
+ if (is_number_pair (min_extent))
+ {
+ Box b;
+ Interval other_extent = g->extent (other_common, other_axis (a));
+ b[a] = ly_scm2interval (min_extent);
+ b[other_axis (a)] = other_extent;
+ if (!other_extent.is_empty ())
+ skylines.insert (b, 0, other_axis (a));
+ }
+
+ /* This skyline was calculated relative to the grob g. In order to compare it to
+ skylines belonging to other grobs, we need to shift it so that it is relative
+ to the common reference. */
+ Real offset = g->relative_coordinate (other_common, other_axis (a));
+ skylines.shift (offset);
+ }
+ else
+ {
+ assert (a == Y_AXIS);
+ Interval extent = g->pure_height (g, start, end);
+ if (!extent.is_empty ())
+ {
+ Box b;
+ b[a] = extent;
+ b[other_axis (a)] = Interval (-infinity_f, infinity_f);
+ skylines.insert (b, 0, other_axis (a));
+ }
+ }
+
+ if (skylines.is_empty ())
+ elements->erase (elements->begin () + i);
+ else
+ ret->push_back (skylines);