- bool encl = to_boolean (me->get_grob_property ("enclose-bounds"));
- span_points[d] = b->extent (common, X_AXIS)[encl ? d : -d];
+ Real encl = robust_scm2double (me->get_property ("enclose-bounds"), 0.0);
+ Interval ext = b->extent (common, X_AXIS);
+
+ span_points[d] =
+ robust_relative_extent (b, common, X_AXIS).linear_combination (d * encl);