- Beam * b = stem_l_->beam_l_;
- if (!b)
- return;
-
- /* ugh. Should be done by beam. */
- Real x = stem_l_->hpos_f ();
- Direction d = stem_l_->get_dir ();
- Real beamy = x * b->slope_f_ + b->left_y_;
- Interval restdim = extent (Y_AXIS);
-
- Real staff_space = rest_l_arr_[0]->staff_line_leading_f ();
- Real internote_f = staff_space/2;
- Real minimum_dist
- = paper_l ()->get_var ("restcollision_minimum_beamdist") * internote_f;
- Real dist =
- minimum_dist + -d * (beamy - restdim[d]) >? 0;
-
- int stafflines = rest_l_arr_[0]->lines_i ();
-
- // move discretely by half spaces.
- int discrete_dist = int (ceil (dist / (0.5 *staff_space)));