-
-
-void
-Side_position_interface::set_axis (Axis a)
-{
- // prop transparent ?
- if (elt_l_->get_elt_property ("side-support") == SCM_UNDEFINED)
- elt_l_->set_elt_property ("side-support" ,SCM_EOL);
-
- elt_l_->dim_cache_[a]->off_callbacks_.push (aligned_side);
+ /*
+ Maintain a minimum distance to the staff. This is similar to side
+ position with padding, but it will put adjoining objects on a row if
+ stuff sticks out of the staff a little.
+ */
+ Grob * st = Staff_symbol_referencer::get_staff_symbol (me);
+ if (st && a == Y_AXIS
+ && scm_is_number (me->get_property ("staff-padding")))
+ {
+ Real padding =
+ Staff_symbol_referencer::staff_space (me)
+ * scm_to_double (me->get_property ("staff-padding"));
+
+ Grob *common = me->common_refpoint (st, Y_AXIS);
+
+ Interval staff_size = st->extent (common, Y_AXIS);
+ Real diff = d*staff_size[d] + padding - d*(o + iv[-d]);
+ o += (d* (diff >? 0));
+ }
+
+ return scm_make_real (o);