+ /*
+ A broken slur should maintain the same vertical trend
+ the unbroken slur would have had.
+ */
+ Offset o;
+ if (Spanner *mother = dynamic_cast<Spanner*> (me->original_l_))
+ {
+ for (int i = dir == LEFT ? 0 : mother->broken_into_l_arr_.size () - 1;
+ dir == LEFT ? i < mother->broken_into_l_arr_.size () : i > 0;
+ dir == LEFT ? i++ : i--)
+ {
+ if (mother->broken_into_l_arr_[i - dir] == me)
+ {
+ Grob *neighbour = mother->broken_into_l_arr_[i];
+ if (dir == RIGHT)
+ neighbour->set_grob_property ("direction",
+ me->get_grob_property ("direction"));
+ Real neighbour_y = get_first_notecolumn_y (neighbour, dir);
+ Real y = get_first_notecolumn_y (me, -dir);
+ int neighbour_cols = scm_ilength (neighbour->get_grob_property ("note-columns"));
+ int cols = scm_ilength (me->get_grob_property ("note-columns"));
+ o = Offset (0, (y*neighbour_cols + neighbour_y*cols) /
+ (cols + neighbour_cols));
+ break;
+ }
+ }
+ }
+ return o;
+}
+
+Offset
+Slur::get_attachment (Grob *me, Direction dir,
+ Grob **common)
+{
+ SCM s = me->get_grob_property ("attachment");
+ if (!gh_symbol_p (index_cell (s, dir)))
+ {
+ set_extremities (me);
+ s = me->get_grob_property ("attachment");
+ }