]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/slur.cc
* The grand 2005-2006 replace.
[lilypond.git] / lily / slur.cc
index 2c8165ac72d60204b502f31b4dce81f5b152164d..bda0ff9ebf4b5c75e7d290ff9fbb3b2d00d22d2c 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1996--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1996--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
   Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
@@ -104,7 +104,7 @@ Slur::print (SCM smob)
 #if DEBUG_SLUR_SCORING
   SCM quant_score = me->get_property ("quant-score");
 
-  if (to_boolean (me->get_layout ()
+  if (to_boolean (me->layout ()
                  ->lookup_variable (ly_symbol2scm ("debug-slur-scoring")))
       && scm_is_string (quant_score))
     {
@@ -112,7 +112,7 @@ Slur::print (SCM smob)
       SCM properties = Font_interface::text_font_alist_chain (me);
 
       Stencil tm = *unsmob_stencil (Text_interface::interpret_markup
-                                   (me->get_layout ()->self_scm (), properties,
+                                   (me->layout ()->self_scm (), properties,
                                     quant_score));
       a.add_at_edge (Y_AXIS, get_grob_direction (me), tm, 1.0, 0);
     }
@@ -152,11 +152,16 @@ SCM
 Slur::outside_slur_callback (SCM grob, SCM offset_scm)
 {
   Grob *script = unsmob_grob (grob);
-  Grob *slur = unsmob_grob (script->get_object ("slur"));
+  Grob *slur = unsmob_grob (script->get_object ("slur")); 
 
   if (!slur)
     return offset_scm;
 
+  SCM avoid = script->get_property ("avoid-slur");
+  if (avoid != ly_symbol2scm ("outside")
+      && avoid != ly_symbol2scm ("around"))
+    return offset_scm;
+  
   Direction dir = get_grob_direction (script);
   if (dir == CENTER)
     return offset_scm;
@@ -185,8 +190,7 @@ Slur::outside_slur_callback (SCM grob, SCM offset_scm)
   bool consider[] = { false, false, false };
   Real ys[] = {0, 0, 0};
   bool do_shift = false;
-  SCM avoid = script->get_property ("avoid-slur");
-
+  
   for (int d = LEFT, k = 0; d <= RIGHT; d++, k++)
     {
       Real x = xext.linear_combination ((Direction) d);
@@ -205,8 +209,7 @@ Slur::outside_slur_callback (SCM grob, SCM offset_scm)
          /* Request shift if slur is contained script's Y, or if
             script is inside slur and avoid == outside.  */
          if (yext.contains (ys[k])
-             || (avoid == ly_symbol2scm ("outside")
-                 && dir * ys[k] > dir * yext[-dir]))
+             || (dir * ys[k] > dir * yext[-dir] && avoid == ly_symbol2scm ("outside")))
            do_shift = true;
        }
     }
@@ -240,6 +243,6 @@ ADD_INTERFACE (Slur, "slur-interface",
               "positions "
               "quant-score "
               "ratio "
-              "slur-details "
+              "details "
               "thickness ");