]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tie.cc
doc fixes, rune pats
[lilypond.git] / lily / tie.cc
index 688a12dece44afd48e502200084051651db20dbe..0f7f0830cefac107bdf7951194c0ccda7457e815 100644 (file)
@@ -52,11 +52,6 @@ Tie::set_interface (Grob*me)
   me->set_grob_property ("heads", gh_cons (SCM_EOL, SCM_EOL));
 }
 
-bool
-Tie::has_interface (Grob*me)
-{
-  return me->has_interface (ly_symbol2scm ("tie-interface"));
-}
 
 Grob*
 Tie::head (Grob*me, Direction d) 
@@ -121,9 +116,11 @@ Tie::get_control_points (SCM smob)
       me->suicide ();
       return SCM_UNSPECIFIED;
     }
+
   
   if (!Directional_element_interface::get (me))
     Directional_element_interface::set (me, Tie::get_default_dir (me));
+  Direction dir = Directional_element_interface::get (me);
   
   Real staff_space = Staff_symbol_referencer::staff_space (me);
 
@@ -138,15 +135,24 @@ Tie::get_control_points (SCM smob)
   Real left_x;
 
   /*
-    this is a kludge: the tie has to be long enough to be
-    visible, but should not go through key sigs.
-
- (please fixme)
+     the tie has to be long enough to be visible, but should not go
+    through key sigs. In the 1.5 series the pref.matter - note
+    distance is fixed , so this won't be a problem anymore.
    */
-  Real lambda = 0.5;           
+  Real lambda = 0.9;           
   
   if (Note_head::has_interface (l))
-    left_x = l->extent (l, X_AXIS)[RIGHT] + x_gap_f;
+    {
+      Real where = RIGHT;
+
+      /*
+       This correction is due te the shape of the black note head.
+       */
+      if (Rhythmic_head::duration_log (l) == 2)
+       where += dir* 0.2;
+      left_x = l->extent (l, X_AXIS).linear_combination (where)
+       + x_gap_f;
+    }
   else
     left_x = l->extent (l, X_AXIS).linear_combination (lambda);
   
@@ -172,7 +178,7 @@ Tie::get_control_points (SCM smob)
          - 2 * x_gap_f;
     }
   
-  Direction dir = Directional_element_interface::get (me);
+
 
   SCM details = me->get_grob_property ("details");
 
@@ -248,6 +254,18 @@ Tie::get_control_points (SCM smob)
        {
          Real y1 = ry + clear;
          Real y2 = ry - clear;
+
+         /*
+           ugh, we shove the 0.5 out of our sleeves.
+
+           Any way. This test is to make sure that staffline
+           collision avoidance does not result in completely flat
+           ties.
+          */
+         if (fabs (y1 - ypos) < 0.5)
+           y1 = y2;
+         else if (fabs (y2 - ypos) < 0.5)
+           y2 = y1;
          
          newy = (fabs (y1 - y) < fabs (y2 - y)) ? y1 : y2;
          
@@ -294,7 +312,7 @@ Tie::brew_molecule (SCM smob)
   
   Real thick =
     gh_scm2double (me->get_grob_property ("thickness"))
-    * me->paper_l ()->get_var ("stafflinethickness");
+    * me->paper_l ()->get_var ("linethickness");
 
   Bezier b;
   int i = 0;