- Interval ext = ly_scm2interval (Axis_group_interface::group_extent_callback
- (me->self_scm (), scm_int2num (Y_AXIS)));
- Real l = ext.length () / staff_space;
-
+
+ SCM elts = me->get_property ("elements");
+ Grob *common = common_refpoint_of_list (elts, me, Y_AXIS);
+
+ Interval ext;
+ for (SCM s = elts; scm_is_pair (s); s = scm_cdr (s))
+ {
+ Spanner *sp = unsmob_spanner (scm_car (s));
+ if (sp
+ && sp->get_bound (LEFT) == me->get_bound (LEFT))
+ {
+ Interval dims = sp->extent (common, Y_AXIS);
+ if (!dims.is_empty ())
+ ext.unite (dims);
+ }
+ }
+
+ ext -= me->relative_coordinate (common, Y_AXIS);
+
+ Real len = ext.length () / staff_space;
+