source file of the GNU LilyPond music typesetter
- (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <math.h> // ceil.
Grob * rc = unsmob_grob (them->get_grob_property ("rest-collision"));
- if (rc && !to_boolean (rc->get_grob_property ("rest-collision-done")))
+ if (rc && !to_boolean (rc->get_grob_property ("positioning-done")))
{
- rc->set_grob_property ("rest-collision-done", SCM_BOOL_T);
+ rc->set_grob_property ("positioning-done", SCM_BOOL_T);
do_shift (rc);
}
TODO: look at horizontal-shift to determine ordering between rests
for more than two voices.
+
+ TODO: look at previous note to determine vertical position?
+
*/
SCM
Rest_collision::do_shift (Grob *me)
for (; i > display_count; i--)
{
Grob* r = unsmob_grob (rests[i-1]->get_grob_property ("rest"));
-#if 1
- if (r)
- r->suicide ();
- rests[i-1]->suicide ();
-#else
if (r)
{
-
- r->set_grob_property ("transparent", gh_bool2scm(1));
- r = unsmob_grob (r->get_grob_property ("dot"));
- if (r)
- r->set_grob_property ("transparent", gh_bool2scm(1));
+ Grob * d = unsmob_grob (r->get_grob_property ("dot"));
+ if (d)
+ d->suicide();
+ r->suicide ();
}
-#endif
+ rests[i-1]->suicide ();
}
}
else
Grob * r = unsmob_grob (rcol->get_grob_property ("rest"));
Interval restdim = r->extent (r, Y_AXIS); // ??
- if (restdim.empty_b ())
+ if (restdim.is_empty ())
return SCM_UNSPECIFIED;
Real staff_space = Staff_symbol_referencer::staff_space (rcol);
- Real minimum_dist = gh_scm2double (me->get_grob_property ("minimum-distance")) * staff_space;
+ Real minimum_dist = robust_scm2double (me->get_grob_property ("minimum-distance"), 1.0) * staff_space;
Grob *common = common_refpoint_of_array (notes, rcol, Y_AXIS);
ADD_INTERFACE (Rest_collision,"rest-collision-interface",
"Move around ordinary rests (not multi-measure-rests) to avoid "
"conflicts.",
- "maximum-rest-count minimum-distance rest-collision-done elements");
+ "maximum-rest-count minimum-distance positioning-done elements");