- if (!skylines)
- conf->attachment_x_ = get_default_attachments (me, common, gap,
- &conf->position_,
- &in_between);
- else
- {
- Real y = staff_space * 0.5 * conf->position_;
- conf->attachment_x_ = get_skyline_attachment (*skylines, y);
- conf->attachment_x_.widen (-gap);
- }
- }
-
- Bezier b = slur_shape (conf->attachment_x_.length(),
- details.height_limit_,
- details.ratio_);
- b.scale (1, conf->dir_);
-
- Offset middle = b.curve_point (0.5);
- Offset edge = b.curve_point (0.0);
-
- conf->position_ = int (rint (conf->position_));
-
- Real dy = fabs (middle[Y_AXIS] - edge[Y_AXIS]);
- bool in_space = !(Staff_symbol_referencer::on_staffline (me, (int) conf->position_));
- bool fits_in_space =
- (dy < 0.6 * staff_space);
-
- /*
- Avoid dot
- */
- Grob *left_dot = unsmob_grob (me->get_bound (LEFT)->get_object ("dot"));
- int dot_pos = left_dot
- ? int (Staff_symbol_referencer::get_position (left_dot))
- : 0;
- if (left_dot
- && (conf->position_ == dot_pos
- || conf->position_ + conf->dir_ == dot_pos))
- {
- conf->position_ += conf->dir_;
- in_space = !in_space;
-
- if (skylines)
- {
- Real y = staff_space * 0.5 * conf->position_;
- conf->attachment_x_ = get_skyline_attachment (*skylines, y);
- conf->attachment_x_.widen (-gap);
- Bezier b = slur_shape (conf->attachment_x_.length(),
- details.height_limit_,
- details.ratio_);
- Offset middle = b.curve_point (0.5);
- Offset edge = b.curve_point (0.0);
- dy = fabs (middle[Y_AXIS] - edge[Y_AXIS]);
- fits_in_space =
- (dy < 0.6 * staff_space);
- }