- /*
- TODO: support self-alignment-{Y, X}
- */
- for (vsize i = 0; i < translates.size (); i++)
- elems[i]->translate_axis (translates[i] - v.center (), a);
-}
+ /* each skyline is calculated relative to (potentially) a different other_axis
+ coordinate. In order to compare the skylines effectively, we need to shift them
+ to some absolute reference point */
+ if (!pure)
+ {
+ Skyline_pair *skys = Skyline_pair::unsmob (g->get_property ("skylines"));
+ if (skys)
+ skylines = *skys;
+ else
+ programming_error ("no skylines for alignment-child\n");
+
+ /* 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 ? "minimum-X-extent" : "minimum-Y-extent");
+
+ if (is_number_pair (min_extent))
+ {
+ Box b;
+ Interval other_extent = g->extent (common_refpoint, 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));
+ }
+
+ Real offset = child_refpoints[i]->relative_coordinate (common_refpoint, 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));
+ }
+ }