diff options
author | Keith OHara <k-ohara5a5a@oco.net> | 2014-03-08 15:45:20 +0100 |
---|---|---|
committer | Janek WarchoĊ <lemniskata.bernoullego@gmail.com> | 2014-03-08 15:45:20 +0100 |
commit | 34b520c618ed0009f553539bda09093fc154a380 (patch) | |
tree | 4a96a99830d239f4ab72e7cd573c1c142b1ff761 /lily | |
parent | 553729eb5bb74cc8b45b2ff0bdce181ff72926bf (diff) |
Fix issue 3868: line-breaking makes short lines
Two simple fixes:
1) Always have some stretchability between notes
2) If there _is_ a completely unstretchable line, shorter than the line-width,
score it as a bad fit, not as a perfect fit (report large forces for stiff lines).
Either one would fix the problem; both seem to be good to have in the code.
Diffstat (limited to 'lily')
-rw-r--r-- | lily/simple-spacer.cc | 2 | ||||
-rw-r--r-- | lily/spacing-basic.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index f3aee71997..2eb545756f 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -193,7 +193,7 @@ Simple_spacer::expand_line () inv_hooke += springs_[i].inverse_stretch_strength (); if (inv_hooke == 0.0) /* avoid division by zero. If springs are infinitely stiff */ - return 0.0; /* anyway, then it makes no difference what the force is */ + inv_hooke = 1e-6; /* then report a very large stretching force */ assert (cur_len <= line_len_); return (line_len_ - cur_len) / inv_hooke + force_; diff --git a/lily/spacing-basic.cc b/lily/spacing-basic.cc index 97868f9bed..df9f9ecec8 100644 --- a/lily/spacing-basic.cc +++ b/lily/spacing-basic.cc @@ -157,7 +157,7 @@ Spacing_spanner::note_spacing (Grob * /* me */, ret = Spring (fraction * len, fraction * min); // Stretch proportional to the space between canonical bare noteheads - ret.set_inverse_stretch_strength (fraction * max (0.0, (len - min))); + ret.set_inverse_stretch_strength (fraction * max (0.1, (len - min))); } else if (delta_t.grace_part_) { |