]> git.donarmstrong.com Git - lilypond.git/commitdiff
Remove old line-spanner code that depended on fixed-distance in PianoStaff.
authorJoe Neeman <joeneeman@gmail.com>
Sun, 4 Feb 2007 16:39:18 +0000 (18:39 +0200)
committerJoe Neeman <joeneeman@gmail.com>
Sun, 4 Feb 2007 16:39:18 +0000 (18:39 +0200)
lily/align-interface.cc
lily/include/align-interface.hh
lily/line-spanner.cc

index 9424877f5ee8b28c0279711bd18609433892fec8..efb7986a217ac0bcce84ccf071909af5157990ca 100644 (file)
@@ -392,22 +392,6 @@ Align_interface::calc_max_stretch (SCM smob)
   return scm_from_double (ret);
 }
 
-/*
-  Find Y-axis parent of G that has a #'forced-distance property. This
-  has the effect of finding the piano-staff given an object in that
-  piano staff.
-
-  FIXME: piano staves no longer have forced-distance. The code that
-  relies on this function (in line-spanner) is broken.
-*/
-Grob *
-find_fixed_alignment_parent (Grob *g)
-{
-  (void) g;
-  programming_error ("deprecated. We don't use forced-distance anymore");
-  return 0;
-}
-
 ADD_INTERFACE (Align_interface,
               
               "Order grobs from top to bottom, left to right, right to left or bottom "
index 8b0e9d94190a65bb8f0230c18f6a1c523c32acd3..91fd53da67b82b8f222aa36fbc9c09942b55752b 100644 (file)
@@ -34,7 +34,5 @@ struct Align_interface
   static Real get_pure_child_y_translation (Grob *, Grob *child, int start, int end);
 };
 
-Grob *find_fixed_alignment_parent (Grob *g);
-
 #endif /* ALIGN_INTERFACE_HH */
 
index f6315451724d0c6a7224ad6fdfdd10ccb9c2cf22..d764a3b717041b909c7f3564660d16913e64e018 100644 (file)
@@ -32,25 +32,6 @@ public:
   DECLARE_GROB_INTERFACE ();
 };
 
-
-static Grob *
-line_spanner_common_parent (Grob *me)
-{
-  /* FIXME: what is the right thing to do here, now that PianoStaves don't
-     have fixed spacing? */
-  Grob *common = 0; //find_fixed_alignment_parent (me);
-  if (!common)
-    {
-      common = Staff_symbol_referencer::get_staff_symbol (me);
-      if (common)
-       common = common->get_parent (Y_AXIS);
-      else
-       common = me->get_parent (Y_AXIS);
-    }
-
-  return common;
-}
-
 SCM
 Line_spanner::calc_bound_info (SCM smob, Direction dir)
 {
@@ -114,13 +95,6 @@ Line_spanner::calc_bound_info (SCM smob, Direction dir)
          
       if (me->get_bound (dir)->break_status_dir ())
        {
-         /*
-           This is hairy. For the normal case, we simply find common
-           parents, and draw a line between the bounds. When two note
-           heads are on different systems, there is no common parent
-           anymore. We have to find the piano-staff object.
-         */
-
          Spanner *next_sp = me->broken_neighbor (dir);
          Item *next_bound = next_sp->get_bound (dir);
 
@@ -132,7 +106,7 @@ Line_spanner::calc_bound_info (SCM smob, Direction dir)
              return SCM_EOL;
            }
 
-         Grob *next_common_y = line_spanner_common_parent (next_bound);
+         Grob *next_common_y = next_sp->common_refpoint (next_bound, X_AXIS);
          Interval next_ext = next_bound->extent (next_common_y, Y_AXIS);
 
          y = next_ext.center ();