]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tie.cc
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / tie.cc
index cd4591fd5186651593a03a1c3e37e0d87d05d985..3f282071e77fe393bad531df74895ef3a97ef840 100644 (file)
@@ -71,7 +71,7 @@ Tie::get_position (Grob *me)
     {
       Grob *h = head (me, d);
       if (h)
-       return (int) Staff_symbol_referencer::get_position (h);
+       return (int) rint (Staff_symbol_referencer::get_position (h));
     }
   while (flip (&d) != LEFT);
 
@@ -122,7 +122,9 @@ Tie::get_default_dir (Grob *me)
       Grob *s = stems[LEFT] ? stems[LEFT] : stems[RIGHT];
       return -get_grob_direction (s);
     }
-
+  else if (int p = get_position (me))
+    return Direction (sign (p));
+  
   return UP;
 }
 
@@ -160,14 +162,16 @@ Tie::set_default_control_points (Grob *me_grob)
   Tie_specification spec = problem.get_tie_specification (0);
   spec.has_manual_dir_ = true;
   spec.manual_dir_ = get_grob_direction (me);
+
+  if (me->is_live ())
+    {
+      Tie_configuration conf
+       = problem.find_optimal_tie_configuration (spec);
   
-  Tie_configuration conf
-    = problem.find_optimal_tie_configuration (spec);
-  
-  set_control_points (me, problem.common_x_refpoint (),
-                     conf, problem.details_);
+      set_control_points (me, problem.common_x_refpoint (),
+                         conf, problem.details_);
+    }
 }
-
 void
 Tie::set_control_points (Grob *me,
                         Grob *common,
@@ -206,7 +210,7 @@ Tie::calc_control_points (SCM smob)
       (void) yparent->get_property ("positioning-done");
     }
 
-  if (!scm_is_pair (me->get_property ("control-points")))
+  if (!scm_is_pair (me->get_property_data (ly_symbol2scm ("control-points"))))
     {
       set_default_control_points (me);
     }
@@ -288,6 +292,7 @@ ADD_INTERFACE (Tie,
               "direction "
               "line-thickness " 
               "quant-score "
+              "staff-position "
               "thickness "
               );