+/*
+ * USE ME ONLY FOR CROSS STAFF SLURS!
+ * We only want to keep the topmost skyline of the topmost axis group(s)
+ * and the bottommost skyline of the bottommost axis group(s). Otherwise,
+ * the VerticalAxisGroups will be spaced very far apart to accommodate the
+ * slur, which we don't want, as it is cross staff.
+ *
+ * TODO: Currently, the code below keeps the topmost and bottommost axis
+ * groups and gets rid of the rest. This should be more nuanced for
+ * cases like ossias where the topmost staff changes over the course of
+ * the slur. Ditto for the bottommost staff.
+ */
+
+MAKE_SCHEME_CALLBACK (Slur, extremal_stub_vertical_skylines, 1);
+SCM
+Slur::extremal_stub_vertical_skylines (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+ Grob *my_vag = Grob::get_vertical_axis_group (me);
+ extract_grob_set (me, "note-columns", ro_note_columns);
+ vector<Grob *> note_columns (ro_note_columns);
+ vector_sort (note_columns, Grob::vertical_less);
+ bool highest = my_vag == Grob::get_vertical_axis_group (note_columns[0]);
+ bool lowest = my_vag == Grob::get_vertical_axis_group (note_columns.back ());
+ if (!highest && !lowest)
+ return Skyline_pair ().smobbed_copy ();
+
+ Skyline_pair sky = *Skyline_pair::unsmob (vertical_skylines (smob));
+
+ if (highest)
+ sky[DOWN] = Skyline (DOWN);
+ else
+ sky[UP] = Skyline (UP);
+
+ return sky.smobbed_copy ();
+}
+