From b76907a5a0c3663895350205e29c7462db4b2b45 Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Fri, 24 Jul 2009 13:36:36 -0700 Subject: Change the treatment of min-distance in springs. Previously, we ensured that the ideal distance was at least as large as the minimum distance, but it sometimes useful not to. Now, if a spring has minimum distance larger than ideal distance, it will remain fixed (at minimum-distance) for a while as you start to stretch it, but it will stretch eventually. This helps give us a more uniform vertical spacing. --- lily/simple-spacer.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lily/simple-spacer.cc') diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index 1d38d9a70f..bab2a05dcb 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -216,7 +216,9 @@ Simple_spacer::compress_line () { Spring sp = sorted_springs[i]; - assert (sp.blocking_force () <= cur_force); + if (sp.blocking_force () > cur_force) + continue; + if (isinf (sp.blocking_force ())) break; @@ -234,7 +236,7 @@ Simple_spacer::compress_line () } cur_len -= block_dist; - inv_hooke -= sp.inverse_compress_strength (); + inv_hooke -= compressed ? sp.inverse_compress_strength () : sp.inverse_stretch_strength (); cur_force = sp.blocking_force (); } -- cgit v1.2.3