]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 787
authorCarl Sorensen <c_sorensen@byu.edu>
Sat, 28 Nov 2009 03:42:11 +0000 (20:42 -0700)
committerCarl Sorensen <c_sorensen@byu.edu>
Sat, 28 Nov 2009 03:43:06 +0000 (20:43 -0700)
input/regression/script-stack-order.ly
lily/script-column.cc

index cca3c7656c2a24939fba6e96a8034cf73f7a4d3b..ce6452082c3c0fa2c951420e88405b421d8c086a 100644 (file)
@@ -9,7 +9,7 @@ order determines the order. Objects specified first are closest to the note.
 
 \layout { ragged-right = ##t}
 
-\relative c'' { c4^"inner up"^"outer up"_"inner down"_"outer down" }
+\relative c'' { c4^"inner up"^"outer up"_"inner down"_"outer down" c c c}
 
 
 
index 30e2b68f62bcf7f3a5d3c34239f7b4726c32eb4c..25c602eca53bc7642e0e2d1ead00f3698eb8e460 100644 (file)
@@ -116,7 +116,7 @@ Script_column::before_line_breaking (SCM smob)
          Side_position_interface::x_aligned_side_proc)
        staff_sided.push_back (sc);
     }
-  
+
   order_grobs (staff_sided);
   return SCM_UNSPECIFIED;
 }
@@ -145,19 +145,25 @@ Script_column::order_grobs (vector<Grob*> grobs)
          Grob *g = unsmob_grob (scm_car (s));
          if (last)
            {
-             SCM outside_staff = last->get_property ("outside-staff-priority");
-             if (scm_is_number (outside_staff))
+             SCM last_outside_staff = last->get_property ("outside-staff-priority");
+             if (scm_is_number (last_outside_staff))
                {
-                 /* we allow the outside-staff-priority ordering to override the
-                    script-priority ordering */
-                 if (!scm_is_number (g->get_property ("outside-staff-priority")))
-                   g->set_property ("outside-staff-priority",
-                                    scm_from_double (scm_to_double (outside_staff) + 0.1));
+                 /*
+                    we allow the outside-staff-priority ordering to override the
+                   script-priority ordering; we must set new
+                    outside-staff-priority if outside-staff-priority is
+                    missing or equal to last
+                  */
+                  SCM g_outside_staff = g->get_property ("outside-staff-priority");
+                 if ((!scm_is_number (g_outside_staff)) ||
+                      (fabs (scm_to_double (g_outside_staff) -
+                             scm_to_double(last_outside_staff)) < 0.001))
+                     g->set_property ("outside-staff-priority",
+                                    scm_from_double (scm_to_double (last_outside_staff) + 0.1));
                }
              else
                Side_position_interface::add_support (g, last);
            }
-
          last = g;
        }
     }
@@ -167,7 +173,7 @@ Script_column::order_grobs (vector<Grob*> grobs)
 ADD_INTERFACE (Script_column,
               "An interface that sorts scripts according to their"
               " @code{script-priority}.",
-              
+
               /* properties */
               ""
               );