-
- Direction dir = Directional_element_interface::get(me);
-
- SCM details = me->get_elt_property ("details");
-
- SCM lim // groetjes aan de chirurgendochter.
- = scm_assq (ly_symbol2scm ("height-limit"),details);
-
- Real h_inf = gh_scm2double (gh_cdr (lim)) * staff_space;
- Real r_0 = gh_scm2double (gh_cdr (scm_assq (ly_symbol2scm ("ratio"),details)));
-
- Bezier b = slur_shape (width, h_inf, r_0);
-
- Offset leave_dir = b.control_[1] - b.control_[0];
-
- Score_element *hed =head (me, headdir);
- Real dx = (hed->extent (hed, X_AXIS).length () + x_gap_f)/2.0;
- Real max_gap = leave_dir[Y_AXIS] * dx / leave_dir[X_AXIS];
-
- /*
- for small ties (t small) we want to start in the Y-center (so dy = 0), for
- large ties, the tie should appear to come from the center of the
- head, so dy = max_gap
-
- maybe use a different formula?
-
- TODO: what if 2 heads have different size.
-
- TODO: for small ties, it is better to start over the heads
- iso. next to the heads.
- */
- Real t = (width / staff_space - 5.0); // ugh.
- Real dy = t > 0 ? max_gap * sqr (t / (1 + t)) : 0.0;
-
- Real ypos = Tie::position_f (me) * staff_space/2 + dir * dy;
-
- /*
- todo: prevent ending / staffline collision.
-
- todo: tie / stem collision
- */
-
- b = slur_shape(width,h_inf, r_0);
- b.scale (1, dir);
- b.translate (Offset (left_x, ypos));
-