]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/constrained-breaking.cc
Merge branch 'master' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond into lilypond...
[lilypond.git] / lily / constrained-breaking.cc
index 1efae87e125047bdd317595a6124408fc5c98e4f..3a56aa47541190b7bd2f6e2669d5292f7e4d1fac 100644 (file)
@@ -4,7 +4,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2006--2007 Joe Neeman <joeneeman@gmail.com>
+  (c) 2006--2009 Joe Neeman <joeneeman@gmail.com>
 */
 
 #include "constrained-breaking.hh"
@@ -123,6 +123,15 @@ Constrained_breaking::space_line (vsize i, vsize j)
   bool last = j == breaks_.size () - 1;
   bool ragged = ragged_right || (last && ragged_last);
 
+  /* As a special case, if there is only one line in the score and ragged-right
+     hasn't been specifically forbidden and the line is stretched, use
+     ragged spacing. */
+  if (last && i == 0
+      && lines_.at (i, j).force_ >= 0
+      && !scm_is_bool (pscore_->layout ()->c_variable ("ragged-right"))
+      && !scm_is_bool (pscore_->layout ()->c_variable ("ragged-last")))
+    ragged = true;
+
   return get_line_configuration (line, line_dims[RIGHT] - line_dims[LEFT], line_dims[LEFT], ragged);
 }