[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Progress on loose columns. (issue4841052)

From: mtsolo
Subject: Progress on loose columns. (issue4841052)
Date: Fri, 05 Aug 2011 18:05:31 +0000

Reviewers: ,

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!

\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,

Progress on loose columns.

Please review this at

Affected files:
  M lily/
  M lily/

Index: lily/
diff --git a/lily/ b/lily/ index 79551ecac37d5d06aaed4ea40175c413179a1ae2..047a4f44dbf51ec7793b9d822496a1d2a582f8d0 100644
--- a/lily/
+++ b/lily/
@@ -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/
diff --git a/lily/ b/lily/
index fb5e326369e5caaf79c6e19a4d5ff95ca793126b..de730e1329a42fee01c103efdaab833565fb9cbb 100644
--- a/lily/
+++ b/lily/
@@ -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;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]