+ if (bound[LEFT]->break_status_dir ())
+ {
+ programming_error ("line-spanner with two broken ends. Farewell sweet world.");
+
+ me->suicide ();
+ return SCM_EOL;
+ }
+
+ /*
+ This is hairy. For the normal case, we simply find common
+ parents, and draw a line between the bounds. When two note
+ heads are on different systems, there is no common parent
+ anymore. We have to find the piano-staff object.
+ */
+
+ int k = broken_spanner_index (me);
+ Spanner *parent_sp = dynamic_cast<Spanner*> (me->original_);
+ Spanner *next_sp = parent_sp->broken_intos_ [k+1];
+ Item *next_bound = next_sp->get_bound (RIGHT);
+
+ if (next_bound->break_status_dir ())
+ {
+ programming_error ("no note heads for the line spanner on next line?"
+ " Confused.");
+ me->suicide ();
+ return SCM_EOL;
+ }
+
+ Grob *commonx = bound[LEFT]->common_refpoint (bound[RIGHT], X_AXIS);
+ commonx = me->common_refpoint (commonx, X_AXIS);
+
+ Grob *next_common_y = line_spanner_common_parent (next_bound);
+ Grob *this_common_y = line_spanner_common_parent (bound[LEFT]);
+
+ Grob *all_common_y = me->common_refpoint (this_common_y, Y_AXIS);
+
+ Interval next_ext = next_bound->extent (next_common_y, Y_AXIS);
+ Interval this_ext = bound[LEFT]->extent (this_common_y, Y_AXIS);
+
+ Real yoff = this_common_y->relative_coordinate (all_common_y, Y_AXIS);
+
+ Offset p1 (bound[LEFT]->extent (commonx, X_AXIS)[RIGHT],
+ this_ext.center () + yoff);
+ Offset p2 (bound[RIGHT]->extent (commonx, X_AXIS)[LEFT],
+ next_ext.center () + yoff);
+
+ Offset dz (p2 -p1);
+ Real len = dz.length ();
+
+ Offset dir = dz *(1/ len);
+ dz = (dz.length () - 2*gap) *dir;
+