1 #include "cross-staff.hh"
3 #include "align-interface.hh"
6 #include "paper-def.hh"
13 calc_interstaff_dist (Item
*item
, Spanner
*span
)
15 Real interstaff
= 0.0;
16 Grob
*common
= item
->common_refpoint (span
, Y_AXIS
);
19 if (Align_interface::has_interface (common
) && Align_interface::axis(common
) == Y_AXIS
)
21 SCM threshold
= common
->get_grob_property ("forced-distance");
23 if (!gh_number_p (threshold
))
24 warning (_ ("not a forced distance; cross-staff spanners may be broken"));
26 interstaff
*= gh_scm2double (threshold
);
28 Grob
* span_refpoint
= span
;
29 while (span_refpoint
->parent_l (Y_AXIS
) != common
)
30 span_refpoint
= span_refpoint
->parent_l (Y_AXIS
);
32 Grob
* note_refpoint
= item
;
33 while (note_refpoint
->parent_l (Y_AXIS
) != common
)
34 note_refpoint
= note_refpoint
->parent_l (Y_AXIS
);
37 Align_interface::get_count (common
,(Grob
*) dynamic_cast<Grob
*> (span_refpoint
));
39 Align_interface::get_count (common
,(Grob
*) dynamic_cast<Grob
*> (note_refpoint
));
42 our staff is lower -> interstaff *= -1
45 if (span_prio
< item_prio
)