- Grob * d = unsmob_grob (me->get_property ("dot"));
- if (d && bt > 4) // UGH.
- {
- d->set_property ("staff-position",
- scm_int2num ((bt == 7) ? 4 : 3));
- }
- if (d && bt >= -1 && bt <= 1) // UGH again.
- {
- d->set_property ("staff-position",
- scm_int2num ((bt == 0) ? -1 : 1));
+ /*
+ 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;