]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/align-interface.cc
release commit
[lilypond.git] / lily / align-interface.cc
index 5bb8c333588317dc1524ffae831cea2c19bdf78f..d9cef2771cff859e092a8567a08a725d003c3fc0 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 2000--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 2000--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
@@ -262,6 +262,27 @@ Align_interface::set_axis (Grob*me,Axis a)
 }
 
 
+/*
+  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.
+ */
+Grob *
+find_fixed_alignment_parent  (Grob *g)
+{
+  while (g)
+    {
+      if (gh_number_p (g->get_grob_property ("forced-distance")))
+       return g;
+
+      g = g->get_parent (Y_AXIS);
+    }
+
+  return 0;
+}
+
+
+
 
 ADD_INTERFACE (Align_interface, "align-interface",
   " Order grobs top to bottom/left to right/right to left etc.",
@@ -272,3 +293,4 @@ struct Foobar
 {
   bool has_interface (Grob*);
 };
+