]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/cross-staff.cc
release: 1.3.37
[lilypond.git] / lily / cross-staff.cc
index c7855b583669f9b90718de85211f4e2dac307215..e1874661219789c6690a770b18c1a0e0c199302c 100644 (file)
@@ -1,6 +1,6 @@
 #include "cross-staff.hh"
 #include "item.hh"
-#include "align-element.hh"
+#include "align-interface.hh"
 #include "spanner.hh"
 #include "warn.hh"
 
@@ -9,10 +9,11 @@ calc_interstaff_dist (Item const *item, Spanner const *span)
 {
   Real interstaff = 0.0; 
   Score_element *common = item->common_refpoint (span, Y_AXIS);
-  Align_element * align = dynamic_cast<Align_element*> (common);
-  if (align && align->axis() == Y_AXIS)
+  Align_interface align(common);
+
+  if (align.has_interface_b () && align.axis() == Y_AXIS)
     {
-      SCM threshold = align->get_elt_property ("threshold");
+      SCM threshold = common->get_elt_property ("threshold");
       if (!gh_pair_p (threshold)
          || !scm_equal_p (gh_car (threshold), gh_cdr (threshold)))
        warning (_ ("minVerticalAlign != maxVerticalAlign: cross staff spanners may be broken"));
@@ -30,9 +31,9 @@ calc_interstaff_dist (Item const *item, Spanner const *span)
        note_refpoint = note_refpoint->parent_l (Y_AXIS);
 
       int span_prio =
-       align->get_count ((Score_element*) dynamic_cast<Score_element const*> (span_refpoint));
+       align.get_count ((Score_element*) dynamic_cast<Score_element const*> (span_refpoint));
       int item_prio =
-       align->get_count ((Score_element*) dynamic_cast<Score_element  const *> (note_refpoint));
+       align.get_count ((Score_element*) dynamic_cast<Score_element  const *> (note_refpoint));
 
       /*
        our staff is lower -> interstaff *= -1