+ * y = length < 5ss : horizontal raakpunt
+ y = length >= 5ss : y next interline - d * 0.25 ss
+ --> height <= 5 length ?? we use <= 3 length, now...
+ */
+
+ Real gap_f = paper_l ()->get_var ("slur_x_gap");
+
+ Direction d = LEFT;
+ do
+ {
+ dy_f_drul_[d] = .5 * interline_f * (head_l_drul_[d]
+ ? head_l_drul_[d]->position_i_
+ : head_l_drul_[(Direction)-d]->position_i_);
+ }
+ while (flip(&d) != LEFT);
+
+ do
+ {
+ // tie attached to outer notehead
+ if (head_l_drul_[d]
+ && head_l_drul_[d]->remove_elt_property (extremal_scm_sym) != SCM_BOOL_F)
+ {
+ if (d == LEFT)
+ dx_f_drul_[d] += notewidth;
+ dx_f_drul_[d] += -d * gap_f;
+ /* attach to outer 3/4 end of head */
+ dy_f_drul_[d] += dir_ * 0.25 * interline_f;
+ }
+ // tie attached to inner notehead
+ else if (head_l_drul_[d] && d == LEFT)
+ {
+ dx_f_drul_[d] += -d * notewidth;
+ }
+ // uhm? loose end of tie // tie attached to stem
+ else
+ {
+ dx_f_drul_[d] = -d * (spanned_drul_[d]->extent (X_AXIS).length ()
+ -0.5 * notewidth);
+ }
+ }
+ while (flip(&d) != LEFT);
+
+ // now that both are set, do dependent
+ do
+ {
+ // tie attached to outer notehead
+ if (!head_l_drul_[d])
+ {
+ dy_f_drul_[d] = dy_f_drul_[(Direction) -d];
+ }
+ }
+ while (flip(&d) != LEFT);
+
+ /*
+ Avoid too steep ties
+ * slur from notehead to stemend: c''()b''
+ */
+ Real damp_f = paper_l ()->get_var ("tie_slope_damping");
+ Offset d_off = Offset (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT],
+ dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]);
+ d_off.x () += extent (X_AXIS).length ();
+
+ Real ratio_f = abs (d_off.y () / d_off.x ());
+ if (ratio_f > damp_f)
+ dy_f_drul_[(Direction)(- dir_ * sign (d_off.y ()))] +=
+ dir_ * (ratio_f - damp_f) * d_off.x ();
+}