- Real min_dist = max (0.0, skys[LEFT].distance (skys[RIGHT]));
- Real min_desired_space = left_head_end + (min_dist - left_head_end) / 2;
-
- /* if the right object sticks out a lot, include a bit of extra space.
- But only for non-musical-columns; this shouldn't apply to accidentals */
- if (!Paper_column::is_musical (right_col))
- min_desired_space = max (min_desired_space,
- left_head_end + LEFT * skys[RIGHT].max_height ());
+ Real distance = skys[LEFT].distance (skys[RIGHT]);
+ Real min_dist = max (0.0, distance);
+ Real min_desired_space = left_head_end + (min_dist - left_head_end + base_space - increment) / 2;
+ Real ideal = base_space - increment + left_head_end;
+
+ /* If we have a NonMusical column on the right, we measure the ideal distance
+ to the bar-line (if present), not the start of the column. */
+ if (!Paper_column::is_musical (right_col)
+ && !skys[RIGHT].is_empty ()
+ && to_boolean (me->get_property ("space-to-barline")))
+ {
+ Grob *bar = Pointer_group_interface::find_grob (right_col,
+ ly_symbol2scm ("elements"),
+ Bar_line::has_interface);