+ /*
+ If, after correcting, we're close to stem-end...
+ */
+ Drul_array<Real> snapy_f_drul;
+ snapy_f_drul[LEFT] = snapy_f_drul[RIGHT] = 0;
+ Drul_array<Real> snapx_f_drul;
+ snapx_f_drul[LEFT] = snapx_f_drul[RIGHT] = 0;
+ Drul_array<bool> snapped_b_drul;
+ snapped_b_drul[LEFT] = snapped_b_drul[RIGHT] = false;
+ do
+ {
+ Note_column * nc = note_column_drul[d];
+ if (nc == spanned_drul_[d]
+ && nc->stem_l_
+ && nc->stem_l_->get_direction () == get_direction ()
+ && abs (nc->stem_l_->extent (Y_AXIS)[get_direction ()]
+ - dy_f_drul_[d] + (d == LEFT ? 0 : interstaff_f))
+ <= snap_f)
+ {
+ /*
+ prepare to attach to stem-end
+ */
+ snapx_f_drul[d] = nc->stem_l_->hpos_f ()
+ - spanned_drul_[d]->relative_coordinate (0, X_AXIS);
+
+ snapy_f_drul[d] = nc->stem_l_->extent (Y_AXIS)[get_direction ()]
+ + interstaff_interval[d]
+ + get_direction () * 2 * y_gap_f;
+
+ snapped_b_drul[d] = true;
+ }
+ }
+ while (flip (&d) != LEFT);