- Link_array<Note_column> encompass_arr =
- Group_interface__extract_elements (this, (Note_column*)0, "note-columns");
-
-
- if (!get_direction ())
- set_direction (get_default_dir ());
-
- /*
- Slur and tie placement [OSU]
-
- Slurs:
- * x = centre of head - d * x_gap_f
-
- TODO:
- * y = length < 5ss : horizontal tangent + d * 0.25 ss
- y = length >= 5ss : y next interline - d * 0.25 ss
- */
-
- Real interline_f = paper_l ()->get_var ("interline");
- Real internote_f = interline_f / 2;
-
- Real x_gap_f = paper_l ()->get_var ("slur_x_gap");
- Real y_gap_f = paper_l ()->get_var ("slur_y_gap");
-
- Drul_array<Note_column*> note_column_drul;
- note_column_drul[LEFT] = encompass_arr[0];
- note_column_drul[RIGHT] = encompass_arr.top ();
-
- bool fix_broken_b = false;
- Direction d = LEFT;
- do
- {
- dx_f_drul_[d] = 0;
- dy_f_drul_[d] = 0;
-
- if ((note_column_drul[d] == spanned_drul_[d])
- && note_column_drul[d]->first_head ()
- && (note_column_drul[d]->stem_l ()))
- {
- Stem* stem_l = note_column_drul[d]->stem_l ();
- /*
- side directly attached to note head;
- no beam getting in the way
- */
- if ((stem_l->extent (Y_AXIS).empty_b ()
- || !((stem_l->get_direction () == get_direction ()) && (get_direction () != d)))
- && !((get_direction () == stem_l->get_direction ())
- && stem_l->beam_l () && (stem_l->beam_count (-d) >= 1)))
- {
- dx_f_drul_[d] = spanned_drul_[d]->extent (X_AXIS).length () / 2;
- dx_f_drul_[d] -= d * x_gap_f;
-
- if (stem_l->get_direction () != get_direction ())
- {
- dy_f_drul_[d] = note_column_drul[d]->extent (Y_AXIS)[get_direction ()];
- }
- else
- {
- dy_f_drul_[d] = stem_l->chord_start_f ()
- + get_direction () * internote_f;
- }
- dy_f_drul_[d] += get_direction () * y_gap_f;
- }
- /*
- side attached to (visible) stem
- */
- else
- {
- dx_f_drul_[d] = stem_l->hpos_f ()
- - spanned_drul_[d]->relative_coordinate (0, X_AXIS);
- /*
- side attached to beamed stem
- */
- if (stem_l->beam_l () && (stem_l->beam_count (-d) >= 1))
- {
- dy_f_drul_[d] = stem_l->extent (Y_AXIS)[get_direction ()];
- dy_f_drul_[d] += get_direction () * 2 * y_gap_f;
- }
- /*
- side attached to notehead, with stem getting in the way
- */
- else
- {
- dx_f_drul_[d] -= d * x_gap_f;
-
- dy_f_drul_[d] = stem_l->chord_start_f ()
- + get_direction () * internote_f;
- dy_f_drul_[d] += get_direction () * y_gap_f;
- }
- }
- }
- /*
- loose end
- */
- else
- {
- dx_f_drul_[d] = get_broken_left_end_align ();
-
- /*
- broken: should get y from other piece, so that slur
- continues up/down trend
-
- for now: be horizontal..
- */
- fix_broken_b = true;
- }
- }
- while (flip (&d) != LEFT);
-
- int cross_count = cross_staff_count ();
- bool interstaff_b = (0 < cross_count) && (cross_count < encompass_arr.size ());
-
- Drul_array<Offset> info_drul;
- Drul_array<Real> interstaff_interval;
-
- do