]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/break-align-item.cc
release: 1.1.67
[lilypond.git] / lily / break-align-item.cc
index 12aa5e08a0664941db2605062d04261bef060628..1e65bbe23ee972c77ee18fabe6e0e28fae476b10 100644 (file)
@@ -6,6 +6,7 @@
   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "dimension-cache.hh"
 #include "lily-guile.hh"
 #include "break-align-item.hh"
 #include "dimensions.hh"
@@ -13,7 +14,6 @@
 #include "paper-def.hh"
 #include "paper-column.hh"
 
-
 /*
   Handle spacing for prefatory matter. 
 
@@ -101,14 +101,17 @@ Break_align_item::do_pre_processing()
   
   scm_set_car_x (first_pair, gh_double2scm (-dists[0]));
   elems[0]->set_elt_property (minimum_space_scm_sym, first_pair);
-                              
-
   
   Axis_align_item::do_pre_processing();
 
-  Real pre_space = elems[0]->extent (X_AXIS)[LEFT];
-  Real spring_len = elems.top ()->extent (X_AXIS)[RIGHT];
-  Real stretch_distance =0.;  
+
+  Real pre_space = elems[0]->extent (X_AXIS)[LEFT]
+    + elems[0]->relative_coordinate (column_l ()->dim_cache_[X_AXIS], X_AXIS);
+  Real spring_len = elems.top ()->extent (X_AXIS)[RIGHT]
+    + elems.top ()->relative_coordinate (column_l ()->dim_cache_[X_AXIS], X_AXIS);
+  
+  Real stretch_distance =0.;
+  
   if (SCM_CAR (symbol_list) == extra_space_scm_sym)
     {
       spring_len += dists.top ();
@@ -120,16 +123,19 @@ Break_align_item::do_pre_processing()
       stretch_distance = spring_len;
     }
 
-
   /*
     Hint the spacing engine how much space to put in.
+
+
+    The pairs are in the format of an interval (ie. CAR <  CDR).
   */
   column_l ()->set_elt_property (extra_space_scm_sym,
                                 scm_cons (gh_double2scm (pre_space),
                                           gh_double2scm (spring_len)));
 
   column_l ()->set_elt_property (stretch_distance_scm_sym,
-                                gh_double2scm (stretch_distance));
+                                gh_cons (gh_double2scm (-dists[0]),
+                                         gh_double2scm (stretch_distance)));
                                 
 }