summaryrefslogtreecommitdiff
path: root/lily/simple-spacer.cc
diff options
context:
space:
mode:
authorJoe Neeman <joeneeman@gmail.com>2009-07-24 13:36:36 -0700
committerJoe Neeman <joeneeman@gmail.com>2009-07-24 13:36:36 -0700
commitb76907a5a0c3663895350205e29c7462db4b2b45 (patch)
tree656019f75130c59f0311ca89de50d48889e36796 /lily/simple-spacer.cc
parentcd3c5c74144d131e3592d15cfd92453c0293ae6b (diff)
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.
Diffstat (limited to 'lily/simple-spacer.cc')
-rw-r--r--lily/simple-spacer.cc6
1 files changed, 4 insertions, 2 deletions
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 ();
}