+ extra_encompass_infos_ = get_extra_encompass_infos ();
+
+ Interval additional_ys (0.0, 0.0);
+
+ for (vsize i = 0; i < extra_encompass_infos_.size (); i++)
+ {
+ if (extra_encompass_infos_[i].extents_[X_AXIS].is_empty ())
+ continue;
+
+ Real y_place = linear_interpolate (extra_encompass_infos_[i].extents_[X_AXIS].center (),
+ base_attachments_[RIGHT][X_AXIS],
+ base_attachments_[LEFT][X_AXIS],
+ end_ys[RIGHT],
+ end_ys[LEFT]);
+ Real encompass_place = extra_encompass_infos_[i].extents_[Y_AXIS][dir_];
+ if (scm_is_eq (extra_encompass_infos_[i].type_,
+ ly_symbol2scm ("inside"))
+ && minmax (dir_, encompass_place, y_place) == encompass_place
+ && (!extra_encompass_infos_[i].grob_->internal_has_interface (ly_symbol2scm ("key-signature-interface"))
+ && !has_interface<Clef> (extra_encompass_infos_[i].grob_)
+ && !extra_encompass_infos_[i].grob_->internal_has_interface (ly_symbol2scm ("time-signature-interface"))))
+ {
+ for (LEFT_and_RIGHT (d))
+ additional_ys[d] = minmax (dir_,
+ additional_ys[d],
+ (dir_
+ * (parameters_.encompass_object_range_overshoot_
+ + (y_place - encompass_place)
+ * (normalize (extra_encompass_infos_[i].extents_[X_AXIS].center (),
+ base_attachments_[RIGHT][X_AXIS],
+ base_attachments_[LEFT][X_AXIS])
+ + (dir_ == LEFT ? 0 : -1)))));
+ }
+ }
+
+ for (LEFT_and_RIGHT (d))
+ end_ys[d] += additional_ys[d];
+