+ {
+ int pos = 4 * get_grob_direction (me);
+
+ /*
+ make a semibreve rest hang from the next line,
+ except for a single line staff
+ */
+ if (duration_log == 0 && Staff_symbol_referencer::line_count (me) > 1)
+ pos += 2;
+
+ /*
+ make sure rest is aligned to a staff line
+ */
+ if (Grob *staff = Staff_symbol_referencer::get_staff_symbol (me))
+ {
+ std::vector<Real> linepos = Staff_symbol::line_positions (staff);
+ std::sort (linepos.begin (), linepos.end ());
+ std::vector<Real>::const_iterator it
+ = std::lower_bound (linepos.begin (), linepos.end (), pos);
+ if (it != linepos.end ())
+ {
+ pos = (int)ceil (*it);
+ }
+ }
+
+ amount = ss * 0.5 * pos;
+ }