]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tie.cc
release: 1.1.29
[lilypond.git] / lily / tie.cc
index 0aead695368b6b9ee48c917f9e2e258ab4512b3e..e559e8ed0eb94800c9b64c5493ac5e5e70c3d5e5 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "paper-def.hh"
@@ -64,9 +64,9 @@ Tie::do_post_processing()
   // URG: share code with slur!
   assert (head_l_drul_[LEFT] || head_l_drul_[RIGHT]);
 
-  Real notewidth = paper ()->note_width ();
+  // URG
+  Real notewidth = paper ()->note_width () * 0.8;
   Real interline_f = paper ()->interline_f ();
-  Real tie_min = paper ()->get_var ("tie_x_minimum");
 
   /* 
    [OSU]: slur and tie placement
@@ -109,7 +109,7 @@ Tie::do_post_processing()
       // uhm? loose end of tie // tie attached to stem
       else
        {
-         dx_f_drul_[d] = -d * (spanned_drul_[d]->width ().length () 
+         dx_f_drul_[d] = -d * (spanned_drul_[d]->extent (X_AXIS).length () 
                                -0.5 * notewidth);
        }
     }
@@ -121,13 +121,6 @@ Tie::do_post_processing()
       // tie attached to outer notehead
       if (!head_l_drul_[d])
        {
-         if (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT] < tie_min)
-           {
-             dx_f_drul_[d] -= d * tie_min 
-               - (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]);
-             dx_f_drul_[d] = dx_f_drul_[(Direction)-d] + d * tie_min;
-           }
-
          dy_f_drul_[d] = dy_f_drul_[(Direction) -d];
        }
     }
@@ -140,12 +133,12 @@ Tie::do_post_processing()
   Real damp_f = paper ()->get_var ("tie_slope_damping");
   Offset d_off = Offset (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT],
     dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]);
-  d_off.x () += width ().length ();
+  d_off.x () += extent (X_AXIS).length ();
 
   Real ratio_f = abs (d_off.y () / d_off.x ());
   if (ratio_f > damp_f)
-    dy_f_drul_[(Direction)(- dir_ * sign (d_off.y ()))] -=
-      dir_ * (damp_f - ratio_f) * d_off.x ();
+    dy_f_drul_[(Direction)(- dir_ * sign (d_off.y ()))] +=
+      dir_ * (ratio_f - damp_f) * d_off.x ();
 }
 
 void
@@ -158,3 +151,21 @@ Tie::do_substitute_dependency (Score_element*o, Score_element*n)
     head_l_drul_[RIGHT] = new_l;
 }
 
+Interval
+Tie::do_width () const
+{
+  Real min_f = paper ()->get_var ("tie_x_minimum");
+  Interval width_int = Bow::do_width ();
+  return width_int.length () < min_f ? Interval (0, min_f) : width_int;
+}
+
+Array<Rod>
+Tie::get_rods () const
+{
+  Array<Rod> a;
+  Rod r;
+  r.item_l_drul_ = spanned_drul_;
+  r.distance_f_ = do_width ().length ();
+  a.push (r);
+  return a;
+}