Reviewers: ,

Message:
Hey all,

This patch makes some headway into the loose column problem, but I am
running into a problem with the length of the rod placed for the loose
column.  Could C++ people with a bit of time please apply this patch,
look at the result, and then look at the pretty print it issues.  You'll
see that the rod is wider than the clef and, yet, when the spacing
finishes, the gap is smaller than the rod.  I was assuming that a rod
attaches to the right of the left `between-columns' and the left of the
right one?  Is this not the case?

Thanks for your help!
~Mike

\version "2.13.36"
\new PianoStaff <<
 \new Staff \relative c' { \times 2/3 {g'4 a2}}
 \new Staff \relative c' {
   \clef bass fis,,8 cis'
   \override Staff . Clef #'color = #red
   \override Staff . Clef #'layer = #100
   \clef treble a'' fis,
 }



Description:
Progress on loose columns.

Please review this at http://codereview.appspot.com/4841052/

Affected files:
  M lily/spacing-determine-loose-columns.cc
  M lily/spacing-loose-columns.cc


Index: lily/spacing-determine-loose-columns.cc
diff --git a/lily/spacing-determine-loose-columns.cc b/lily/spacing-determine-loose-columns.cc index 79551ecac37d5d06aaed4ea40175c413179a1ae2..047a4f44dbf51ec7793b9d822496a1d2a582f8d0 100644
--- a/lily/spacing-determine-loose-columns.cc
+++ b/lily/spacing-determine-loose-columns.cc
@@ -176,7 +176,7 @@ Spacing_spanner::set_distances_for_loose_col (Grob *me, Grob *c,
   Rod r;
   r.distance_ = dists[LEFT] + dists[RIGHT];
   r.item_drul_ = next_door;
-
+printf ("this is the length of the rod: %4.4f this is the width of the clef: %4.4f\n",r.distance_,robust_relative_extent (c,next_door[LEFT],X_AXIS).length ());
   r.add_to_cols ();
 }

Index: lily/spacing-loose-columns.cc
diff --git a/lily/spacing-loose-columns.cc b/lily/spacing-loose-columns.cc
index fb5e326369e5caaf79c6e19a4d5ff95ca793126b..de730e1329a42fee01c103efdaab833565fb9cbb 100644
--- a/lily/spacing-loose-columns.cc
+++ b/lily/spacing-loose-columns.cc
@@ -162,13 +162,20 @@ set_loose_columns (System *which, Column_x_positions const *posns)

       Grob *finished_right_column = clique.back ();

+      Real total_pushing = 0.0;
+      for (vsize j = clique.size () - 2; j > 0; j--)
+        total_pushing += clique_spacing[j];
+
+ Real permissable_distance = clique.back ()->relative_coordinate (common, X_AXIS) - robust_relative_extent (clique[0], common, X_AXIS)[RIGHT];
+      Real scale_factor = permissable_distance / total_pushing;
+
       for (vsize j = clique.size () - 2; j > 0; j--)
         {
Paper_column *clique_col = dynamic_cast<Paper_column *> (clique[j]);

right_point = finished_right_column->relative_coordinate (common, X_AXIS);

-          Real distance_to_next = clique_spacing[j];
+          Real distance_to_next = clique_spacing[j] * scale_factor;

           Real my_offset = right_point - distance_to_next;




_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to