/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 2005--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Spacing_spanner::standard_breakable_column_spacing (Grob *me, Item *l, Item *r, Spacing_options const *options)
{
Real min_dist = max (0.0, Paper_column::minimum_distance (l, r));
- Real ideal;
if (Paper_column::is_breakable (l) && Paper_column::is_breakable (r))
{
mlen = *dt;
Real incr = robust_scm2double (me->get_property ("spacing-increment"), 1);
+ Real space = incr * double (mlen.main_part_ / options->global_shortest_) * 0.8;
+ Spring spring = Spring (min_dist + space, min_dist);
- ideal = min_dist + incr * double (mlen.main_part_ / options->global_shortest_) * 0.8;
+ /*
+ By default, the spring will have an inverse_stretch_strength of space+min_dist.
+ However, we don't want stretchability to scale with min_dist or else an
+ empty first measure on a line (which has a large min_dist because of the clef)
+ will stretch much more than an empty measure later in the line.
+ */
+ spring.set_inverse_stretch_strength (space);
+ return spring;
}
- else
- {
- Moment dt = Paper_column::when_mom (r) - Paper_column::when_mom (l);
- if (dt == Moment (0, 0))
- {
- /*
- In this case, Staff_spacing should handle the job,
- using dt when it is 0 is silly.
- */
- ideal = min_dist + 0.5;
- }
- else
- ideal = min_dist + options->get_duration_space (dt.main_part_);
+ Moment dt = Paper_column::when_mom (r) - Paper_column::when_mom (l);
+ Real ideal;
+
+ if (dt == Moment (0, 0))
+ {
+ /*
+ In this case, Staff_spacing should handle the job,
+ using dt when it is 0 is silly.
+ */
+ ideal = min_dist + 0.5;
}
+ else
+ ideal = min_dist + options->get_duration_space (dt.main_part_);
+
return Spring (ideal, min_dist);
}