]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/page-spacing.hh
Merge commit 'origin/dev/jneeman' into systems-per-page
[lilypond.git] / lily / include / page-spacing.hh
index c2dbc2ea6e8aa55ff614126dec327414389e7150..958a1b21ff08b2bffd51b5746db2f29abaf91daf 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>
 */
 
 #ifndef PAGE_SPACING_HH
    but small enough that nothing will overflow to infinity (so that we
    can still distinguish bad spacings by the number of BAD_SPACING_PENALTYs
    that they incur.
+
+   BAD_SPACING_PENALTY is for occasions where the spacing is bad.
+   TERRIBLE_SPACING_PENALTY is for when we are disregarding a user override
+   (for example, we are failing to satisfy min-systems-per-page). These user
+   overrides are more important than getting good spacing, so they get a
+   larger penalty.
 */
-const Real BAD_SPACING_PENALTY = 200000;
+const Real BAD_SPACING_PENALTY = 1e6;
+const Real TERRIBLE_SPACING_PENALTY = 1e8;
 
 
 /* for page_count > 2, we use a dynamic algorithm similar to
@@ -46,12 +53,14 @@ private:
       force_ = infinity_f;
       penalty_ = infinity_f;
       prev_ = VPOS;
+      system_count_status_ = SYSTEM_COUNT_OK;
     }
 
     Real demerits_;
     Real force_;
     Real penalty_;
     vsize prev_;
+    int system_count_status_;
   };
 
   Page_breaking const *breaker_;