+ Hmm, maybe after-line-breaking should set this to loose-end? */
+ else // if (str == "loose-end")
+ {
+ SCM other_a = dir == LEFT ? ly_cdr (s) : ly_car (s);
+ if (ly_symbol2string (other_a) != "loose-end")
+ o = broken_trend_offset (me, dir);
+ }
+
+ SCM alist = me->get_property ("extremity-offset-alist");
+ int stemdir = stem ? Stem::get_direction (stem) : 1;
+ SCM l = scm_assoc
+ (scm_list_n (a,
+ scm_int2num (stemdir * dir),
+ scm_int2num (slurdir * dir),
+ SCM_UNDEFINED), alist);
+
+ if (l != SCM_BOOL_F)
+ {
+ Offset off = ly_scm2offset (ly_cdr (l)) * staff_space;
+ off[X_AXIS] *= dir;
+ off[Y_AXIS] *= slurdir;
+ o += off;
+ }
+
+ /*
+ What if get_bound () is not a note-column?
+ */
+ if (str != "loose-end"
+ && sp->get_bound (dir)->common_refpoint (common[Y_AXIS], Y_AXIS) == common[Y_AXIS])
+ {
+ o[Y_AXIS] += sp->get_bound (dir)->relative_coordinate (common[Y_AXIS], Y_AXIS)
+ - me->relative_coordinate (common[Y_AXIS], Y_AXIS);
+ }
+
+ Offset off = ly_scm2offset (index_get_cell (me->get_property
+ ("attachment-offset"),
+ dir)) * staff_space;
+
+ off[Y_AXIS] *= slurdir;
+ o += off;
+ return o;
+}
+
+Offset
+Slur::encompass_offset (Grob*me,
+ Grob* col,
+ Grob **common)
+{
+ Offset o;
+ Grob* stem = unsmob_grob (col->get_property ("stem"));
+
+ Direction dir = get_grob_direction (me);
+
+ if (!stem)
+ {
+ programming_error ("No stem for note column?");
+ o[X_AXIS] = col->relative_coordinate (common[X_AXIS], X_AXIS);
+ o[Y_AXIS] = col->relative_coordinate (common[Y_AXIS], Y_AXIS);
+ return o;
+ }
+ Direction stem_dir = get_grob_direction (stem);
+ o[X_AXIS] = stem->relative_coordinate (0, X_AXIS);
+
+ /*
+ Simply set x to middle of notehead
+ */
+ Real x_extent;
+ if (Grob *head = Note_column::first_head (col))
+ x_extent = head->extent (head, X_AXIS).length ();
+ else
+ x_extent = col->extent (col, X_AXIS).length ();
+ o[X_AXIS] -= 0.5 * stem_dir * x_extent;
+
+ if ((stem_dir == dir)
+ && !stem->extent (stem, Y_AXIS).is_empty ())
+ {
+ o[Y_AXIS] = stem->extent (common[Y_AXIS], Y_AXIS)[dir];
+ }
+ else
+ {
+ o[Y_AXIS] = col->extent (common[Y_AXIS], Y_AXIS)[dir];
+ }
+
+ /*
+ leave a gap: slur mustn't touch head/stem
+ */
+ o[Y_AXIS] += dir * robust_scm2double (me->get_property ("y-free"), 0) *
+ 1.0;